From 9c436979fb498d5cba9d6274aac612c6b2b00f9b Mon Sep 17 00:00:00 2001 From: Andreas Gerstmayr Date: Thu, 1 Feb 2024 17:06:59 +0100 Subject: [PATCH] Add debug instructions for upgrade e2e test (#770) Signed-off-by: Andreas Gerstmayr --- .github/workflows/e2e.yaml | 4 ++-- Makefile | 5 +---- tests/e2e-upgrade/upgrade/60-assert.yaml | 8 ++++++++ tests/e2e-upgrade/upgrade/README.md | 17 +++++++++++++++++ tests/e2e-upgrade/upgrade/tempostack.yaml | 2 +- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 61aa76e0d..77e4a83c0 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -98,12 +98,12 @@ jobs: - name: Install kuttl, OLM and minio run: | ./hack/install/install-kuttl.sh - make olm-install deploy-minio + make olm-install - name: Build and push operator and bundle image to local container registry run: | export LATEST_TAG=$(git describe --tags --abbrev=0) - export BUNDLE_IMGS=ghcr.io/grafana/tempo-operator/tempo-operator-bundle:${LATEST_TAG},localregistry:5000/tempo-operator-bundle:v100.0.0 + export BUNDLE_IMGS=ghcr.io/grafana/tempo-operator/tempo-operator-bundle:${LATEST_TAG},${IMG_PREFIX}/tempo-operator-bundle:v${OPERATOR_VERSION} make bundle docker-build docker-push bundle-build bundle-push catalog-build catalog-push env: IMG_PREFIX: localregistry:5000 diff --git a/Makefile b/Makefile index aa0596902..b7f06f57f 100644 --- a/Makefile +++ b/Makefile @@ -351,16 +351,13 @@ deploy-minio: # generic end-to-tests .PHONY: prepare-e2e -prepare-e2e: kuttl start-kind cert-manager deploy-minio set-test-image-vars build docker-build load-image-operator deploy +prepare-e2e: kuttl start-kind cert-manager set-test-image-vars build docker-build load-image-operator deploy .PHONY: e2e e2e: $(KUTTL) test # OpenShift end-to-tests -.PHONY: prepare-e2e-openshift -prepare-e2e-openshift: deploy-minio - .PHONY: e2e-openshift e2e-openshift: $(KUTTL) test --config kuttl-test-openshift.yaml diff --git a/tests/e2e-upgrade/upgrade/60-assert.yaml b/tests/e2e-upgrade/upgrade/60-assert.yaml index b20a2951b..0d5a23650 100644 --- a/tests/e2e-upgrade/upgrade/60-assert.yaml +++ b/tests/e2e-upgrade/upgrade/60-assert.yaml @@ -21,3 +21,11 @@ metadata: name: simplest status: operatorVersion: 100.0.0 +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: +- command: kubectl -n kuttl-operator-upgrade get subscriptions.operators.coreos.com tempo -o yaml +- namespace: kuttl-operator-upgrade + selector: app.kubernetes.io/name=tempo-operator + tail: 100 diff --git a/tests/e2e-upgrade/upgrade/README.md b/tests/e2e-upgrade/upgrade/README.md index 61191f761..bb85b520f 100644 --- a/tests/e2e-upgrade/upgrade/README.md +++ b/tests/e2e-upgrade/upgrade/README.md @@ -13,3 +13,20 @@ * switch catalog to new catalog * assert operator got upgraded * verify traces are still there + +## Running the upgrade test with minikube +``` +# specify a container registry with push permissions +export IMG_PREFIX=docker.io/${USER} + +minikube start +make olm-install + +export OPERATOR_VERSION=100.0.0 +export LATEST_TAG=$(git describe --tags --abbrev=0) +export BUNDLE_IMGS=ghcr.io/grafana/tempo-operator/tempo-operator-bundle:${LATEST_TAG},${IMG_PREFIX}/tempo-operator-bundle:v${OPERATOR_VERSION} +make bundle docker-build docker-push bundle-build bundle-push catalog-build catalog-push + +sed -i "s@localregistry:5000@${IMG_PREFIX}@g" tests/e2e-upgrade/upgrade/10-setup-olm.yaml +kubectl-kuttl test --config kuttl-test-upgrade.yaml --skip-delete +``` diff --git a/tests/e2e-upgrade/upgrade/tempostack.yaml b/tests/e2e-upgrade/upgrade/tempostack.yaml index d2a4e5705..976f43d17 100644 --- a/tests/e2e-upgrade/upgrade/tempostack.yaml +++ b/tests/e2e-upgrade/upgrade/tempostack.yaml @@ -5,5 +5,5 @@ metadata: spec: storage: secret: - name: example + name: minio type: s3