From d55a36fdc76c1aa42df64c1b0514668518d15278 Mon Sep 17 00:00:00 2001 From: "Per G. da Silva" Date: Tue, 31 Mar 2026 13:24:26 +0200 Subject: [PATCH] fix(e2e): replace ${TEST_NAMESPACE} with plain text in feature files Replace interpolation-style `${TEST_NAMESPACE}` references with `test namespace` in Gherkin steps and remove the redundant step patterns that matched the `${TEST_NAMESPACE}` syntax, consolidating on the plain-text step definitions. Co-Authored-By: Claude Opus 4.6 (1M context) --- test/e2e/features/install.feature | 4 ++-- test/e2e/features/recover.feature | 14 +++++++------- test/e2e/features/status.feature | 2 +- test/e2e/features/uninstall.feature | 2 +- test/e2e/features/update.feature | 2 +- test/e2e/features/user-managed-fields.feature | 2 +- test/e2e/steps/steps.go | 5 ++--- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/test/e2e/features/install.feature b/test/e2e/features/install.feature index 0e34383e94..63335d89ab 100644 --- a/test/e2e/features/install.feature +++ b/test/e2e/features/install.feature @@ -6,7 +6,7 @@ Feature: Install ClusterExtension Background: Given OLM is available And ClusterCatalog "test" serves bundles - And ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + And ServiceAccount "olm-sa" with needed permissions is available in test namespace Scenario: Install latest available version When ClusterExtension is applied @@ -594,7 +594,7 @@ Feature: Install ClusterExtension @BoxcutterRuntime @PreflightPermissions Scenario: Boxcutter preflight check detects missing CREATE permissions - Given ServiceAccount "olm-sa" without create permissions is available in ${TEST_NAMESPACE} + Given ServiceAccount "olm-sa" without create permissions is available in test namespace And ClusterExtension is applied """ apiVersion: olm.operatorframework.io/v1 diff --git a/test/e2e/features/recover.feature b/test/e2e/features/recover.feature index c222756a47..b7610c5dfc 100644 --- a/test/e2e/features/recover.feature +++ b/test/e2e/features/recover.feature @@ -5,7 +5,7 @@ Feature: Recover cluster extension from errors that might occur during its lifet And ClusterCatalog "test" serves bundles Scenario: Restore removed resource - Given ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + Given ServiceAccount "olm-sa" with needed permissions is available in test namespace And ClusterExtension is applied """ apiVersion: olm.operatorframework.io/v1 @@ -49,12 +49,12 @@ Feature: Recover cluster extension from errors that might occur during its lifet "olm.operatorframework.io/metadata.name": test-catalog """ And ClusterExtension reports Progressing as True with Reason Retrying - When ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + When ServiceAccount "olm-sa" with needed permissions is available in test namespace Then ClusterExtension is available And ClusterExtension reports Progressing as True with Reason Succeeded Scenario: Install ClusterExtension after conflicting resource is removed - Given ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + Given ServiceAccount "olm-sa" with needed permissions is available in test namespace And resource is applied """ apiVersion: apps/v1 @@ -118,7 +118,7 @@ Feature: Recover cluster extension from errors that might occur during its lifet @PreflightPermissions Scenario: ClusterExtension installation succeeds after service account gets the required missing permissions to manage the bundle's resources - Given ServiceAccount "olm-sa" is available in ${TEST_NAMESPACE} + Given ServiceAccount "olm-sa" is available in test namespace And ClusterExtension is applied """ apiVersion: olm.operatorframework.io/v1 @@ -145,7 +145,7 @@ Feature: Recover cluster extension from errors that might occur during its lifet """ Namespace:"" APIGroups:[apiextensions.k8s.io] Resources:[customresourcedefinitions] ResourceNames:[olme2etests.olm.operatorframework.io] Verbs:[delete,get,patch,update] """ - When ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + When ServiceAccount "olm-sa" with needed permissions is available in test namespace Then ClusterExtension is available And ClusterExtension reports Progressing as True with Reason Succeeded And ClusterExtension reports Installed as True @@ -163,7 +163,7 @@ Feature: Recover cluster extension from errors that might occur during its lifet # - If the controller stopped reconciling, the configmap would stay deleted # - Resource restoration is an observable event that PROVES active reconciliation # - The deployment staying healthy proves the workload continues running - Given ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + Given ServiceAccount "olm-sa" with needed permissions is available in test namespace And ClusterExtension is applied """ apiVersion: olm.operatorframework.io/v1 @@ -203,7 +203,7 @@ Feature: Recover cluster extension from errors that might occur during its lifet # - Reconciliation completing (observedGeneration == generation) proves the spec was processed # - Progressing=Succeeded proves the controller didn't block on missing catalog # - Extension staying Available proves workload continues running - Given ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + Given ServiceAccount "olm-sa" with needed permissions is available in test namespace And ClusterExtension is applied """ apiVersion: olm.operatorframework.io/v1 diff --git a/test/e2e/features/status.feature b/test/e2e/features/status.feature index 28631d6e3e..01b0bf7a96 100644 --- a/test/e2e/features/status.feature +++ b/test/e2e/features/status.feature @@ -6,7 +6,7 @@ Feature: Report status of the managed ClusterExtension workload Background: Given OLM is available And ClusterCatalog "test" serves bundles - And ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + And ServiceAccount "olm-sa" with needed permissions is available in test namespace And ClusterExtension is applied """ apiVersion: olm.operatorframework.io/v1 diff --git a/test/e2e/features/uninstall.feature b/test/e2e/features/uninstall.feature index e14b8494fe..89290ada68 100644 --- a/test/e2e/features/uninstall.feature +++ b/test/e2e/features/uninstall.feature @@ -6,7 +6,7 @@ Feature: Uninstall ClusterExtension Background: Given OLM is available And ClusterCatalog "test" serves bundles - And ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + And ServiceAccount "olm-sa" with needed permissions is available in test namespace And ClusterExtension is applied """ apiVersion: olm.operatorframework.io/v1 diff --git a/test/e2e/features/update.feature b/test/e2e/features/update.feature index 483fc328e0..ab9408365e 100644 --- a/test/e2e/features/update.feature +++ b/test/e2e/features/update.feature @@ -6,7 +6,7 @@ Feature: Update ClusterExtension Background: Given OLM is available And ClusterCatalog "test" serves bundles - And ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + And ServiceAccount "olm-sa" with needed permissions is available in test namespace Scenario: Update to a successor version Given ClusterExtension is applied diff --git a/test/e2e/features/user-managed-fields.feature b/test/e2e/features/user-managed-fields.feature index 9046dc0670..6c830bbe34 100644 --- a/test/e2e/features/user-managed-fields.feature +++ b/test/e2e/features/user-managed-fields.feature @@ -7,7 +7,7 @@ Feature: Preserve user-managed fields on deployed resources Background: Given OLM is available And ClusterCatalog "test" serves bundles - And ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + And ServiceAccount "olm-sa" with needed permissions is available in test namespace And ClusterExtension is applied """ apiVersion: olm.operatorframework.io/v1 diff --git a/test/e2e/steps/steps.go b/test/e2e/steps/steps.go index 131d5ccfe1..75183c1ead 100644 --- a/test/e2e/steps/steps.go +++ b/test/e2e/steps/steps.go @@ -125,9 +125,8 @@ func RegisterSteps(sc *godog.ScenarioContext) { sc.Step(`^(?i)ServiceAccount "([^"]*)" with permissions to install extensions is available in "([^"]*)" namespace$`, ServiceAccountWithNeededPermissionsIsAvailableInGivenNamespace) sc.Step(`^(?i)ServiceAccount "([^"]*)" with needed permissions is available in test namespace$`, ServiceAccountWithNeededPermissionsIsAvailableInTestNamespace) - sc.Step(`^(?i)ServiceAccount "([^"]*)" with needed permissions is available in \${TEST_NAMESPACE}$`, ServiceAccountWithNeededPermissionsIsAvailableInTestNamespace) - sc.Step(`^(?i)ServiceAccount "([^"]*)" without create permissions is available in \${TEST_NAMESPACE}$`, ServiceAccountWithoutCreatePermissionsIsAvailableInTestNamespace) - sc.Step(`^(?i)ServiceAccount "([^"]*)" is available in \${TEST_NAMESPACE}$`, ServiceAccountIsAvailableInNamespace) + sc.Step(`^(?i)ServiceAccount "([^"]*)" without create permissions is available in test namespace$`, ServiceAccountWithoutCreatePermissionsIsAvailableInTestNamespace) + sc.Step(`^(?i)ServiceAccount "([^"]*)" is available in test namespace$`, ServiceAccountIsAvailableInNamespace) sc.Step(`^(?i)ServiceAccount "([^"]*)" in test namespace is cluster admin$`, ServiceAccountWithClusterAdminPermissionsIsAvailableInNamespace) sc.Step(`^(?i)ServiceAccount "([^"]+)" in test namespace has permissions to fetch "([^"]+)" metrics$`, ServiceAccountWithFetchMetricsPermissions) sc.Step(`^(?i)ServiceAccount "([^"]+)" sends request to "([^"]+)" endpoint of "([^"]+)" service$`, SendMetricsRequest)