Skip to content

Commit 0b90d53

Browse files
committed
Fix conformance suite
The conformance suite was using deprecated ginkgo v1 functionality. This commit migrates it to v2, which makes the tests run again. Signed-off-by: Lennart Jern <lennart.jern@est.tech>
1 parent 7e898a9 commit 0b90d53

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
@@ -218,10 +218,12 @@ test-e2e-image-prerequisites:
218218

219219
CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
220220
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)
221-
CONFORMANCE_GINKGO_ARGS ?= -stream
222221
.PHONY: test-conformance
223222
test-conformance: $(GINKGO) e2e-prerequisites ## Run clusterctl based conformance test on workload cluster (requires Docker).
224-
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)
223+
time $(GINKGO) -trace -show-node-events -v -tags=e2e -focus="conformance" $(CONFORMANCE_GINKGO_ARGS) \
224+
./test/e2e/suites/conformance/... -- \
225+
-config-path="$(E2E_CONF_PATH)" -artifacts-folder="$(ARTIFACTS)" \
226+
--data-folder="$(E2E_DATA_DIR)" $(CONFORMANCE_E2E_ARGS)
225227

226228
test-conformance-fast: ## Run clusterctl based conformance test on workload cluster (requires Docker) using a subset of the conformance suite in parallel.
227229
$(MAKE) test-conformance CONFORMANCE_E2E_ARGS="-kubetest.config-file=$(KUBETEST_FAST_CONF_PATH) -kubetest.ginkgo-nodes=5 $(E2E_ARGS)"
@@ -381,9 +383,9 @@ staging-manifests:
381383
##@ Release
382384
## --------------------------------------
383385

384-
ifneq (,$(findstring -,$(RELEASE_TAG)))
385-
PRE_RELEASE=true
386-
endif
386+
ifneq (,$(findstring -,$(RELEASE_TAG)))
387+
PRE_RELEASE=true
388+
endif
387389
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)
388390
## set by Prow, ref name of the base branch, e.g., main
389391
RELEASE_DIR := out
@@ -392,11 +394,11 @@ RELEASE_NOTES_DIR := _releasenotes
392394
.PHONY: $(RELEASE_DIR)
393395
$(RELEASE_DIR):
394396
mkdir -p $(RELEASE_DIR)/
395-
397+
396398
.PHONY: $(RELEASE_NOTES_DIR)
397399
$(RELEASE_NOTES_DIR):
398400
mkdir -p $(RELEASE_NOTES_DIR)/
399-
401+
400402
.PHONY: $(BUILD_DIR)
401403
$(BUILD_DIR):
402404
@mkdir -p $(BUILD_DIR)
@@ -596,7 +598,7 @@ compile-e2e: ## Test e2e compilation
596598
.PHONY: FORCE
597599
FORCE:
598600

599-
## --------------------------------------
601+
## --------------------------------------
600602
## Helpers
601603
## --------------------------------------
602604

test/e2e/data/e2e_conf.yaml

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

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

1211
managementClusterName: capo-e2e
1312

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)