Skip to content

Commit abfd8d5

Browse files
authored
Merge pull request #2294 from Nordix/lentzi90/fix-conformance-suite
🌱 Fix conformance suite
2 parents 2ba90a4 + 0b90d53 commit abfd8d5

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ out
4949
# Vscode files
5050
.vscode
5151

52+
# Zed files
53+
.zed_server
54+
5255
# This is where the result of the go build goes
5356
/output*/
5457
/_output*/

Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,12 @@ test-e2e-image-prerequisites:
215215

216216
CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
217217
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)
218-
CONFORMANCE_GINKGO_ARGS ?= -stream
219218
.PHONY: test-conformance
220219
test-conformance: $(GINKGO) e2e-prerequisites ## Run clusterctl based conformance test on workload cluster (requires Docker).
221-
time $(GINKGO) -trace -show-node-events -v -tags=e2e -focus="conformance" $(CONFORMANCE_GINKGO_ARGS) ./test/e2e/suites/conformance/... -- -config-path="$(E2E_CONF_PATH)" -artifacts-folder="$(ARTIFACTS)" --data-folder="$(E2E_DATA_DIR)" $(CONFORMANCE_E2E_ARGS)
220+
time $(GINKGO) -trace -show-node-events -v -tags=e2e -focus="conformance" $(CONFORMANCE_GINKGO_ARGS) \
221+
./test/e2e/suites/conformance/... -- \
222+
-config-path="$(E2E_CONF_PATH)" -artifacts-folder="$(ARTIFACTS)" \
223+
--data-folder="$(E2E_DATA_DIR)" $(CONFORMANCE_E2E_ARGS)
222224

223225
test-conformance-fast: ## Run clusterctl based conformance test on workload cluster (requires Docker) using a subset of the conformance suite in parallel.
224226
$(MAKE) test-conformance CONFORMANCE_E2E_ARGS="-kubetest.config-file=$(KUBETEST_FAST_CONF_PATH) -kubetest.ginkgo-nodes=5 $(E2E_ARGS)"
@@ -378,9 +380,9 @@ staging-manifests:
378380
##@ Release
379381
## --------------------------------------
380382

381-
ifneq (,$(findstring -,$(RELEASE_TAG)))
382-
PRE_RELEASE=true
383-
endif
383+
ifneq (,$(findstring -,$(RELEASE_TAG)))
384+
PRE_RELEASE=true
385+
endif
384386
PREVIOUS_TAG ?= $(shell git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$" | sort -V | grep -B1 $(RELEASE_TAG) | head -n 1 2>/dev/null)
385387
## set by Prow, ref name of the base branch, e.g., main
386388
RELEASE_DIR := out
@@ -389,11 +391,11 @@ RELEASE_NOTES_DIR := _releasenotes
389391
.PHONY: $(RELEASE_DIR)
390392
$(RELEASE_DIR):
391393
mkdir -p $(RELEASE_DIR)/
392-
394+
393395
.PHONY: $(RELEASE_NOTES_DIR)
394396
$(RELEASE_NOTES_DIR):
395397
mkdir -p $(RELEASE_NOTES_DIR)/
396-
398+
397399
.PHONY: $(BUILD_DIR)
398400
$(BUILD_DIR):
399401
@mkdir -p $(BUILD_DIR)
@@ -593,7 +595,7 @@ compile-e2e: ## Test e2e compilation
593595
.PHONY: FORCE
594596
FORCE:
595597

596-
## --------------------------------------
598+
## --------------------------------------
597599
## Helpers
598600
## --------------------------------------
599601

test/e2e/data/e2e_conf.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
# To run tests, run the following from the root of this repository.
66
# `OPENSTACK_CLOUD=capo-e2e OPENSTACK_CLOUD_YAML_FILE=/tmp/clouds.yaml make test-conformance`
7-
# The -stream flag will make Ginkgo print results to the screen in real-time.
87

98
managementClusterName: capo-e2e
109

test/e2e/suites/conformance/conformance_test.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727

2828
. "github.com/onsi/ginkgo/v2"
2929
. "github.com/onsi/gomega"
30+
"github.com/onsi/gomega/gmeasure"
3031
corev1 "k8s.io/api/core/v1"
3132
"k8s.io/utils/ptr"
3233
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
@@ -39,7 +40,6 @@ import (
3940
var _ = Describe("conformance tests", func() {
4041
var (
4142
namespace *corev1.Namespace
42-
ctx context.Context
4343
specName = "conformance"
4444
)
4545

@@ -53,7 +53,7 @@ var _ = Describe("conformance tests", func() {
5353
shared.ApplyCoreImagesPlus(ctx, e2eCtx)
5454
})
5555

56-
Measure(specName, func(b Benchmarker) {
56+
It(specName, func(ctx context.Context) {
5757
name := fmt.Sprintf("cluster-%s", namespace.Name)
5858
kubernetesVersion := e2eCtx.E2EConfig.GetVariable(shared.KubernetesVersion)
5959

@@ -70,7 +70,10 @@ var _ = Describe("conformance tests", func() {
7070
controlPlaneMachineCount, err := strconv.ParseInt(e2eCtx.E2EConfig.GetVariable("CONFORMANCE_CONTROL_PLANE_MACHINE_COUNT"), 10, 64)
7171
Expect(err).NotTo(HaveOccurred())
7272

73-
b.Time("cluster creation", func() {
73+
experiment := gmeasure.NewExperiment(specName)
74+
AddReportEntry(experiment.Name, experiment)
75+
76+
experiment.MeasureDuration("cluster creation", func() {
7477
result := &clusterctl.ApplyClusterTemplateAndWaitResult{}
7578
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
7679
ClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
@@ -93,7 +96,7 @@ var _ = Describe("conformance tests", func() {
9396
})
9497

9598
workloadProxy := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, namespace.Name, name)
96-
b.Time("conformance suite", func() {
99+
experiment.MeasureDuration("conformance suite", func() {
97100
err := kubetest.Run(ctx,
98101
kubetest.RunInput{
99102
ClusterProxy: workloadProxy,
@@ -104,10 +107,5 @@ var _ = Describe("conformance tests", func() {
104107
)
105108
Expect(err).To(BeNil(), "error on kubetest execution")
106109
})
107-
}, 1)
108-
109-
AfterEach(func() {
110-
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
111-
shared.DumpSpecResourcesAndCleanup(ctx, specName, namespace, e2eCtx)
112110
})
113111
})

0 commit comments

Comments
 (0)