Skip to content

Commit c78b25c

Browse files
Per G. da Silvaclaude
andcommitted
Fix experimental-to-experimental upgrade e2e to deploy baseline from main
The ex2ex upgrade test was using the latest release as the baseline, but experimental features may not exist in any published release. Deploy from origin/main instead, so the upgrade path tests main -> PR for experimental manifests. - Add hack/test/deploy-from-main.sh to build and deploy from main - Add run-main-experimental Makefile target that invokes the new script - Add TEST_UPGRADE_EX2EX_E2E_TASKS that uses run-main-experimental - Wire test-upgrade-ex2ex-e2e to the new task list Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Per G. da Silva <[email protected]>
1 parent af6733e commit c78b25c

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ run-latest-release:
335335
@echo -e "\n\U23EC Using $(RELEASE_INSTALL) as release installer\n"
336336
curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/$(notdir $(RELEASE_INSTALL)) | bash -s
337337

338+
.PHONY: run-main-experimental
339+
run-main-experimental:
340+
KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) ./hack/test/deploy-from-main.sh
341+
338342
.PHONY: pre-upgrade-setup
339343
pre-upgrade-setup:
340344
./hack/test/pre-upgrade-setup.sh $(CATALOG_IMG) $(TEST_CLUSTER_CATALOG_NAME) $(TEST_CLUSTER_EXTENSION_NAME)
@@ -345,6 +349,7 @@ post-upgrade-checks:
345349

346350

347351
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
352+
TEST_UPGRADE_EX2EX_E2E_TASKS := run-main-experimental image-registry pre-upgrade-setup docker-build kind-load kind-deploy post-upgrade-checks kind-clean
348353

349354
.PHONY: test-upgrade-st2st-e2e
350355
test-upgrade-st2st-e2e: SOURCE_MANIFEST := $(STANDARD_MANIFEST)
@@ -357,12 +362,11 @@ test-upgrade-st2st-e2e: $(TEST_UPGRADE_E2E_TASKS) #HELP Run upgrade (standard ->
357362

358363
.PHONY: test-upgrade-ex2ex-e2e
359364
test-upgrade-ex2ex-e2e: SOURCE_MANIFEST := $(EXPERIMENTAL_MANIFEST)
360-
test-upgrade-ex2ex-e2e: RELEASE_INSTALL := $(EXPERIMENTAL_RELEASE_INSTALL)
361365
test-upgrade-ex2ex-e2e: KIND_CLUSTER_NAME := operator-controller-upgrade-ex2ex-e2e
362366
test-upgrade-ex2ex-e2e: export MANIFEST := $(EXPERIMENTAL_RELEASE_MANIFEST)
363367
test-upgrade-ex2ex-e2e: export TEST_CLUSTER_CATALOG_NAME := test-catalog
364368
test-upgrade-ex2ex-e2e: export TEST_CLUSTER_EXTENSION_NAME := test-package
365-
test-upgrade-ex2ex-e2e: $(TEST_UPGRADE_E2E_TASKS) #HELP Run upgrade (experimental -> experimental) e2e tests on a local kind cluster
369+
test-upgrade-ex2ex-e2e: $(TEST_UPGRADE_EX2EX_E2E_TASKS) #HELP Run upgrade (experimental -> experimental) e2e tests on a local kind cluster
366370

367371
.PHONY: test-upgrade-st2ex-e2e
368372
test-upgrade-st2ex-e2e: SOURCE_MANIFEST := $(EXPERIMENTAL_MANIFEST)

hack/test/deploy-from-main.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# This script builds and deploys operator-controller from the main branch
5+
# as the baseline for experimental-to-experimental upgrade tests.
6+
# Instead of upgrading from the latest release, this allows comparing
7+
# main -> PR for experimental features that may not exist in any release yet.
8+
9+
# Save current HEAD so we can return after building from main
10+
CLONE_DIR="$(mktemp -d)"
11+
cleanup() {
12+
echo "Cleaning up ${CLONE_DIR}"
13+
rm -rf $CLONE_DIR
14+
}
15+
16+
echo "Checking out main branch to ${CLONE_DIR}"
17+
git clone --depth 1 --branch main [email protected]:perdasilva/operator-framework-operator-controller.git ${CLONE_DIR}
18+
19+
echo "Deploying operator-controller@main"
20+
cd ${CLONE_DIR} && make run-experimental

0 commit comments

Comments
 (0)