Skip to content

Commit 045989d

Browse files
authored
Add upgrade e2es for standard to experimental (operator-framework#2360)
Signed-off-by: Todd Short <[email protected]>
1 parent 0fecf3f commit 045989d

File tree

2 files changed

+95
-102
lines changed

2 files changed

+95
-102
lines changed

.github/workflows/e2e.yaml

Lines changed: 46 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -9,105 +9,67 @@ on:
99
- main
1010

1111
jobs:
12-
extension-developer-e2e:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v6
16-
17-
- uses: actions/setup-go@v6
18-
with:
19-
go-version-file: go.mod
20-
21-
- name: Run the extension developer e2e test
22-
run: make test-extension-developer-e2e
23-
24-
e2e-kind:
12+
e2e:
2513
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
test:
18+
- name: extension-developer-e2e
19+
make-target: test-extension-developer-e2e
20+
use-artifacts: false
21+
use-codecov: false
22+
- name: e2e
23+
make-target: test-e2e
24+
use-artifacts: true
25+
use-codecov: true
26+
- name: experimental-e2e
27+
make-target: test-experimental-e2e
28+
use-artifacts: true
29+
use-codecov: true
30+
- name: upgrade-st2st-e2e
31+
make-target: test-upgrade-st2st-e2e
32+
use-artifacts: true
33+
use-codecov: false
34+
- name: upgrade-ex2ex-e2e
35+
make-target: test-upgrade-ex2ex-e2e
36+
use-artifacts: true
37+
use-codecov: false
38+
- name: upgrade-st2ex-e2e
39+
make-target: test-upgrade-st2ex-e2e
40+
use-artifacts: true
41+
use-codecov: false
42+
- name: st2ex-e2e
43+
make-target: test-st2ex-e2e
44+
use-artifacts: true
45+
use-codecov: false
46+
name: ${{ matrix.test.name }}
2647
steps:
2748
- uses: actions/checkout@v6
28-
with:
29-
fetch-depth: 0
3049

3150
- uses: actions/setup-go@v6
3251
with:
3352
go-version-file: go.mod
3453

35-
- name: Run e2e tests
36-
run: ARTIFACT_PATH=/tmp/artifacts E2E_SUMMARY_OUTPUT=$GITHUB_STEP_SUMMARY make test-e2e
54+
- name: Run e2e test
55+
run: |
56+
if [[ "${{ matrix.test.use-artifacts }}" == "true" ]]; then
57+
ARTIFACT_PATH=/tmp/artifacts E2E_SUMMARY_OUTPUT=$GITHUB_STEP_SUMMARY make ${{ matrix.test.make-target }}
58+
else
59+
make ${{ matrix.test.make-target }}
60+
fi
3761
3862
- uses: actions/upload-artifact@v5
39-
if: failure()
63+
if: failure() && matrix.test.use-artifacts == true
4064
with:
41-
name: e2e-artifacts
65+
name: ${{ matrix.test.name }}-artifacts
4266
path: /tmp/artifacts/
4367

4468
- uses: codecov/[email protected]
69+
if: matrix.test.use-codecov == true
4570
with:
4671
disable_search: true
47-
files: coverage/e2e.out
48-
flags: e2e
72+
files: coverage/${{ matrix.test.name }}.out
73+
flags: ${{ matrix.test.name }}
4974
token: ${{ secrets.CODECOV_TOKEN }}
5075

51-
experimental-e2e:
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v6
55-
with:
56-
fetch-depth: 0
57-
58-
- uses: actions/setup-go@v6
59-
with:
60-
go-version-file: go.mod
61-
62-
- name: Run e2e tests
63-
run: ARTIFACT_PATH=/tmp/artifacts E2E_SUMMARY_OUTPUT=$GITHUB_STEP_SUMMARY make test-experimental-e2e
64-
65-
- uses: actions/upload-artifact@v5
66-
if: failure()
67-
with:
68-
name: experimental-e2e-artifacts
69-
path: /tmp/artifacts/
70-
71-
- uses: codecov/[email protected]
72-
with:
73-
disable_search: true
74-
files: coverage/experimental-e2e.out
75-
flags: experimental-e2e
76-
token: ${{ secrets.CODECOV_TOKEN }}
77-
78-
upgrade-e2e:
79-
runs-on: ubuntu-latest
80-
steps:
81-
- uses: actions/checkout@v6
82-
83-
- uses: actions/setup-go@v6
84-
with:
85-
go-version-file: go.mod
86-
87-
- name: Run the upgrade e2e test
88-
run: ARTIFACT_PATH=/tmp/artifacts make test-upgrade-e2e
89-
90-
- uses: actions/upload-artifact@v5
91-
if: failure()
92-
with:
93-
name: upgrade-e2e-artifacts
94-
path: /tmp/artifacts/
95-
96-
upgrade-experimental-e2e:
97-
runs-on: ubuntu-latest
98-
steps:
99-
- uses: actions/checkout@v6
100-
101-
- uses: actions/setup-go@v6
102-
with:
103-
go-version-file: go.mod
104-
105-
- name: Run the upgrade e2e test
106-
run: ARTIFACT_PATH=/tmp/artifacts make test-upgrade-experimental-e2e
107-
108-
- uses: actions/upload-artifact@v5
109-
if: failure()
110-
with:
111-
name: upgrade-experimental-e2e-artifacts
112-
path: /tmp/artifacts/
113-

Makefile

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ test-extension-developer-e2e: run-internal image-registry extension-developer-e2
303303

304304
.PHONY: run-latest-release
305305
run-latest-release:
306+
@echo -e "\n\U23EC Using $(RELEASE_INSTALL) as release installer\n"
306307
curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/$(notdir $(RELEASE_INSTALL)) | bash -s
307308

308309
.PHONY: pre-upgrade-setup
@@ -316,24 +317,41 @@ post-upgrade-checks:
316317

317318
TEST_UPGRADE_E2E_TASKS := kind-cluster run-latest-release image-registry pre-upgrade-setup docker-build kind-load kind-deploy post-upgrade-checks kind-clean
318319

319-
.PHONY: test-upgrade-e2e
320-
test-upgrade-e2e: SOURCE_MANIFEST := $(STANDARD_MANIFEST)
321-
test-upgrade-e2e: RELEASE_INSTALL := $(STANDARD_RELEASE_INSTALL)
322-
test-upgrade-e2e: KIND_CLUSTER_NAME := operator-controller-upgrade-e2e
323-
test-upgrade-e2e: export MANIFEST := $(STANDARD_RELEASE_MANIFEST)
324-
test-upgrade-e2e: export TEST_CLUSTER_CATALOG_NAME := test-catalog
325-
test-upgrade-e2e: export TEST_CLUSTER_EXTENSION_NAME := test-package
326-
test-upgrade-e2e: $(TEST_UPGRADE_E2E_TASKS) #HELP Run upgrade e2e tests on a local kind cluster
327-
328-
.PHONY: test-upgrade-experimental-e2e
329-
test-upgrade-experimental-e2e: SOURCE_MANIFEST := $(EXPERIMENTAL_MANIFEST)
330-
test-upgrade-experimental-e2e: RELEASE_INSTALL := $(EXPERIMENTAL_RELEASE_INSTALL)
331-
test-upgrade-experimental-e2e: KIND_CLUSTER_NAME := operator-controller-upgrade-experimental-e2e
332-
test-upgrade-experimental-e2e: export MANIFEST := $(EXPERIMENTAL_RELEASE_MANIFEST)
333-
test-upgrade-experimental-e2e: export TEST_CLUSTER_CATALOG_NAME := test-catalog
334-
test-upgrade-experimental-e2e: export TEST_CLUSTER_EXTENSION_NAME := test-package
335-
test-upgrade-experimental-e2e: $(TEST_UPGRADE_E2E_TASKS) #HELP Run upgrade e2e tests on a local kind cluster
336-
320+
.PHONY: test-upgrade-st2st-e2e
321+
test-upgrade-st2st-e2e: SOURCE_MANIFEST := $(STANDARD_MANIFEST)
322+
test-upgrade-st2st-e2e: RELEASE_INSTALL := $(STANDARD_RELEASE_INSTALL)
323+
test-upgrade-st2st-e2e: KIND_CLUSTER_NAME := operator-controller-upgrade-st2st-e2e
324+
test-upgrade-st2st-e2e: export MANIFEST := $(STANDARD_RELEASE_MANIFEST)
325+
test-upgrade-st2st-e2e: export TEST_CLUSTER_CATALOG_NAME := test-catalog
326+
test-upgrade-st2st-e2e: export TEST_CLUSTER_EXTENSION_NAME := test-package
327+
test-upgrade-st2st-e2e: $(TEST_UPGRADE_E2E_TASKS) #HELP Run upgrade (standard -> standard) e2e tests on a local kind cluster
328+
329+
.PHONY: test-upgrade-ex2ex-e2e
330+
test-upgrade-ex2ex-e2e: SOURCE_MANIFEST := $(EXPERIMENTAL_MANIFEST)
331+
test-upgrade-ex2ex-e2e: RELEASE_INSTALL := $(EXPERIMENTAL_RELEASE_INSTALL)
332+
test-upgrade-ex2ex-e2e: KIND_CLUSTER_NAME := operator-controller-upgrade-ex2ex-e2e
333+
test-upgrade-ex2ex-e2e: export MANIFEST := $(EXPERIMENTAL_RELEASE_MANIFEST)
334+
test-upgrade-ex2ex-e2e: export TEST_CLUSTER_CATALOG_NAME := test-catalog
335+
test-upgrade-ex2ex-e2e: export TEST_CLUSTER_EXTENSION_NAME := test-package
336+
test-upgrade-ex2ex-e2e: $(TEST_UPGRADE_E2E_TASKS) #HELP Run upgrade (experimental -> experimental) e2e tests on a local kind cluster
337+
338+
.PHONY: test-upgrade-st2ex-e2e
339+
test-upgrade-st2ex-e2e: SOURCE_MANIFEST := $(EXPERIMENTAL_MANIFEST)
340+
test-upgrade-st2ex-e2e: RELEASE_INSTALL := $(STANDARD_RELEASE_INSTALL)
341+
test-upgrade-st2ex-e2e: KIND_CLUSTER_NAME := operator-controller-upgrade-st2ex-e2e
342+
test-upgrade-st2ex-e2e: export MANIFEST := $(EXPERIMENTAL_RELEASE_MANIFEST)
343+
test-upgrade-st2ex-e2e: export TEST_CLUSTER_CATALOG_NAME := test-catalog
344+
test-upgrade-st2ex-e2e: export TEST_CLUSTER_EXTENSION_NAME := test-package
345+
test-upgrade-st2ex-e2e: $(TEST_UPGRADE_E2E_TASKS) #HELP Run upgrade (standard -> experimental) e2e tests on a local kind cluster
346+
347+
.PHONY: test-st2ex-e2e
348+
test-st2ex-e2e: SOURCE_MANIFEST := $(STANDARD_MANIFEST)
349+
test-st2ex-e2e: RELEASE_INSTALL := $(STANDARD_RELEASE_INSTALL)
350+
test-st2ex-e2e: KIND_CLUSTER_NAME := operator-controller-st2ex-e2e
351+
test-st2ex-e2e: export MANIFEST := $(STANDARD_RELEASE_MANIFEST)
352+
test-st2ex-e2e: export TEST_CLUSTER_CATALOG_NAME := test-catalog
353+
test-st2ex-e2e: export TEST_CLUSTER_EXTENSION_NAME := test-package
354+
test-st2ex-e2e: run-internal image-registry pre-upgrade-setup kind-deploy-experimental post-upgrade-checks kind-clean #HELP Run swichover (standard -> experimental) e2e tests on a local kind cluster
337355

338356
.PHONY: e2e-coverage
339357
e2e-coverage:
@@ -375,6 +393,18 @@ kind-deploy: manifests
375393
cp $(CATALOGS_MANIFEST) $(DEFAULT_CATALOG)
376394
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
377395

396+
.PHONY: kind-deploy-experimental
397+
kind-deploy-experimental: export DEFAULT_CATALOG := $(RELEASE_CATALOGS)
398+
kind-deploy-experimental: SOURCE_MANIFEST := $(EXPERIMENTAL_MANIFEST)
399+
kind-deploy-experimental: export MANIFEST := $(EXPERIMENTAL_RELEASE_MANIFEST)
400+
kind-deploy-experimental: NAMESPACE := olmv1-system
401+
# Have to be a _completely_ separate recipe, rather than having `kind-deploy` as a dependency, because `make` will think it was already built
402+
kind-deploy-experimental: manifests
403+
@echo -e "\n\U1F4D8 Using $(SOURCE_MANIFEST) as source manifest\n"
404+
sed "s/cert-git-version/cert-$(VERSION)/g" $(SOURCE_MANIFEST) > $(MANIFEST)
405+
cp $(CATALOGS_MANIFEST) $(DEFAULT_CATALOG)
406+
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
407+
378408
.PHONY: kind-cluster
379409
kind-cluster: $(KIND) kind-verify-versions #EXHELP Standup a kind cluster.
380410
-$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)
@@ -452,6 +482,7 @@ run-experimental: export MANIFEST := $(EXPERIMENTAL_RELEASE_MANIFEST)
452482
run-experimental: run-internal #HELP Build the operator-controller then deploy it with the experimental manifest into a new kind cluster.
453483

454484
CATD_NAMESPACE := olmv1-system
485+
.PHONY: wait
455486
wait:
456487
kubectl wait --for=condition=Available --namespace=$(CATD_NAMESPACE) deployment/catalogd-controller-manager --timeout=60s
457488
kubectl wait --for=condition=Ready --namespace=$(CATD_NAMESPACE) certificate/catalogd-service-cert # Avoid upgrade test flakes when reissuing cert

0 commit comments

Comments
 (0)