Skip to content

Commit d1f7a6b

Browse files
committed
Run e2e upgrade tests in isolation
Signed-off-by: Andrea Mazzotti <[email protected]>
1 parent 7758a6c commit d1f7a6b

File tree

11 files changed

+45
-10
lines changed

11 files changed

+45
-10
lines changed

.github/workflows/e2e.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,29 @@ jobs:
3131
name: e2e-artifacts
3232
path: _artifacts
3333
if-no-files-found: ignore
34+
e2e-tests-upgrade:
35+
runs-on: runs-on,runner=4cpu-linux-x64,run-id=${{ github.run_id }}
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v6
39+
with:
40+
fetch-depth: 0
41+
- name: Install Go
42+
uses: actions/setup-go@v6
43+
with:
44+
go-version-file: go.mod
45+
- name: Setup kind
46+
uses: helm/[email protected]
47+
with:
48+
install_only: true
49+
- name: Run E2E tests
50+
env:
51+
GINKGO_LABEL_FILTER: upgrade
52+
run: make test-e2e
53+
- name: Archive artifacts
54+
if: always()
55+
uses: actions/[email protected]
56+
with:
57+
name: e2e-upgrade-artifacts
58+
path: _artifacts
59+
if-no-files-found: ignore

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ kubectl: # Download kubectl cli into tools bin folder
397397

398398
# Allow overriding the e2e configurations
399399
GINKGO_FOCUS ?=
400+
GINKGO_LABEL_FILTER ?= "default"
400401
GINKGO_SKIP ?= "Pivot" # See: https://github.com/rancher/cluster-api-provider-rke2/issues/691
401402
GINKGO_NODES ?= 1
402403
GINKGO_NOCOLOR ?= false
@@ -411,7 +412,7 @@ SKIP_CREATE_MGMT_CLUSTER ?= false
411412
.PHONY: test-e2e-run
412413
test-e2e-run: $(GINKGO) $(KUSTOMIZE) kubectl e2e-image inotify-check ## Run the end-to-end tests
413414
LOCAL_IMAGES="$(LOCAL_IMAGES)" CAPI_KUSTOMIZE_PATH="$(KUSTOMIZE)" $(GINKGO) -v -poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER) -poll-progress-interval=$(GINKGO_POLL_PROGRESS_INTERVAL) \
414-
--tags=e2e --focus="$(GINKGO_FOCUS)" --skip="$(GINKGO_SKIP)" --nodes=$(GINKGO_NODES) --no-color=$(GINKGO_NOCOLOR) \
415+
--tags=e2e --focus="$(GINKGO_FOCUS)" --label-filter="$(GINKGO_LABEL_FILTER)" --skip="$(GINKGO_SKIP)" --nodes=$(GINKGO_NODES) --no-color=$(GINKGO_NOCOLOR) \
415416
--timeout=$(GINKGO_TIMEOUT) --output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" $(GINKGO_ARGS) ./test/e2e -- \
416417
-e2e.artifacts-folder="$(ARTIFACTS)" \
417418
-e2e.config="$(E2E_CONF_FILE)" \

metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ releaseSeries:
7171
contract: v1beta1
7272
- major: 0
7373
minor: 22
74-
contract: v1beta1
74+
contract: v1beta2

test/e2e/const.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ const (
3232
timeout480s = 480
3333
)
3434

35+
const (
36+
// DefaultTestsLabel is used for all default tests that run on the same test management cluster.
37+
DefaultTestsLabel = "default"
38+
// UpgradeTestsLabel is used to run upgrade tests standalone.
39+
// These tests may need to install a different version of CAPI, requiring management cluster isolation.
40+
UpgradeTestsLabel = "upgrade"
41+
)
42+
3543
var (
3644
//go:embed data/infrastructure/clusterclass-template-docker.yaml
3745
ClusterClassDocker []byte

test/e2e/e2e_clusterclass_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"sigs.k8s.io/cluster-api/util"
3535
)
3636

37-
var _ = Describe("Cluster Class provisioning", func() {
37+
var _ = Describe("Cluster Class provisioning", Label(DefaultTestsLabel), func() {
3838
var (
3939
specName = "cluster-class-provisioning"
4040
namespace *corev1.Namespace

test/e2e/e2e_external_datastore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"sigs.k8s.io/cluster-api/util"
3434
)
3535

36-
var _ = Describe("External Datastore", func() {
36+
var _ = Describe("External Datastore", Label(DefaultTestsLabel), func() {
3737
var (
3838
specName = "create-workload-cluster-with-external-datastore"
3939
namespace *corev1.Namespace

test/e2e/e2e_in_place_propagation_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import (
4141
"sigs.k8s.io/controller-runtime/pkg/client"
4242
)
4343

44-
var _ = Describe("In-place propagation", func() {
44+
var _ = Describe("In-place propagation", Label(DefaultTestsLabel), func() {
4545
var (
4646
specName = "in-place-propagation"
4747
namespace *corev1.Namespace
@@ -123,7 +123,7 @@ var _ = Describe("In-place propagation", func() {
123123

124124
By("Verifying the cluster is available")
125125
framework.VerifyClusterAvailable(ctx, framework.VerifyClusterAvailableInput{
126-
Getter: bootstrapClusterProxy.GetClient(),
126+
Getter: bootstrapClusterProxy.GetClient(),
127127
Name: result.Cluster.Name,
128128
Namespace: result.Cluster.Namespace,
129129
})

test/e2e/e2e_pivot_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
"sigs.k8s.io/controller-runtime/pkg/client"
3838
)
3939

40-
var _ = Describe("Bootstrap & Pivot", func() {
40+
var _ = Describe("Bootstrap & Pivot", Label(DefaultTestsLabel), func() {
4141
var (
4242
specName = "bootstrap-pivot-cluster"
4343
namespace *corev1.Namespace

test/e2e/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838
"sigs.k8s.io/controller-runtime/pkg/client"
3939
)
4040

41-
var _ = Describe("Workload cluster creation", func() {
41+
var _ = Describe("Workload cluster creation", Label(DefaultTestsLabel), func() {
4242
var (
4343
specName = "create-workload-cluster"
4444
namespace *corev1.Namespace

test/e2e/e2e_upgrade_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import (
4444
"sigs.k8s.io/controller-runtime/pkg/client"
4545
)
4646

47-
var _ = Describe("Provider upgrade", func() {
47+
var _ = Describe("Provider upgrade", Label(UpgradeTestsLabel), func() {
4848
var (
4949
specName = "provider-upgrade"
5050
namespace *corev1.Namespace

0 commit comments

Comments
 (0)