From 73b217e7dd3e6d1f847554e1979222a340ae0ac7 Mon Sep 17 00:00:00 2001 From: Kashif Khan Date: Wed, 24 Apr 2024 14:39:34 +0300 Subject: [PATCH] Remove keep test env related vars and configs Signed-off-by: Kashif Khan --- Makefile | 3 --- test/e2e/e2e_suite_test.go | 4 ---- test/e2e/ip_reuse_test.go | 6 ------ test/e2e/live_iso_test.go | 6 ------ test/e2e/pivoting_based_feature_test.go | 6 ------ test/e2e/remediation_based_feature_test.go | 6 ------ test/e2e/upgrade_clusterctl_test.go | 5 ----- test/e2e/upgrade_kubernetes_test.go | 6 ------ 8 files changed, 42 deletions(-) diff --git a/Makefile b/Makefile index a196a3f707..f5723f652a 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,6 @@ E2E_CONF_FILE_ENVSUBST ?= $(E2E_OUT_DIR)/$(notdir $(E2E_CONF_FILE)) E2E_CONTAINERS ?= quay.io/metal3-io/cluster-api-provider-metal3 quay.io/metal3-io/baremetal-operator quay.io/metal3-io/ip-address-manager SKIP_CLEANUP ?= false -KEEP_TEST_ENV ?= false EPHEMERAL_TEST ?= false SKIP_CREATE_MGMT_CLUSTER ?= true @@ -192,13 +191,11 @@ e2e-tests: $(GINKGO) e2e-substitutions cluster-templates # This target should be $(GINKGO) --timeout=$(GINKGO_TIMEOUT) -v --trace --tags=e2e \ --show-node-events --no-color=$(GINKGO_NOCOLOR) \ - --fail-fast="$(KEEP_TEST_ENV)" \ --junit-report="junit.e2e_suite.1.xml" \ --focus="$(GINKGO_FOCUS)" $(_SKIP_ARGS) "$(ROOT_DIR)/$(TEST_DIR)/e2e/" -- \ -e2e.artifacts-folder="$(ARTIFACTS)" \ -e2e.config="$(E2E_CONF_FILE_ENVSUBST)" \ -e2e.skip-resource-cleanup=$(SKIP_CLEANUP) \ - -e2e.keep-test-environment=$(KEEP_TEST_ENV) \ -e2e.trigger-ephemeral-test=$(EPHEMERAL_TEST) \ -e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER) diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index bf91338a2d..84f632a0bd 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -47,9 +47,6 @@ var ( // ephemeralTest triggers only e2e test in ephemeral cluster if true. ephemeralTest bool - - // keepTestEnv keeps the test environment by aborting the test suite when e2e test fails. - keepTestEnv bool ) // Test suite global vars. @@ -82,7 +79,6 @@ func init() { flag.StringVar(&configPath, "e2e.config", "", "path to the e2e config file") flag.StringVar(&artifactFolder, "e2e.artifacts-folder", "", "folder where e2e test artifact should be stored") flag.BoolVar(&skipCleanup, "e2e.skip-resource-cleanup", false, "if true, the resource cleanup after tests will be skipped") - flag.BoolVar(&keepTestEnv, "e2e.keep-test-environment", false, "if true, the test aborts when failed, keeping all the environment") flag.BoolVar(&upgradeTest, "e2e.trigger-upgrade-test", false, "if true, the e2e upgrade test will be triggered and other tests will be skipped") flag.BoolVar(&ephemeralTest, "e2e.trigger-ephemeral-test", false, "if true, all e2e tests run in the ephemeral cluster without pivoting to the target cluster") flag.BoolVar(&useExistingCluster, "e2e.use-existing-cluster", true, "if true, the test uses the current cluster instead of creating a new one (default discovery rules apply)") diff --git a/test/e2e/ip_reuse_test.go b/test/e2e/ip_reuse_test.go index 7a4e951d91..a1902ece81 100644 --- a/test/e2e/ip_reuse_test.go +++ b/test/e2e/ip_reuse_test.go @@ -39,12 +39,6 @@ var _ = Describe("When testing ip reuse [ip-reuse] [features]", Label("ip-reuse" ListMetal3Machines(ctx, bootstrapClusterProxy.GetClient(), client.InNamespace(namespace)) ListMachines(ctx, bootstrapClusterProxy.GetClient(), client.InNamespace(namespace)) ListNodes(ctx, targetCluster.GetClient()) - // Abort the test in case of failure and keepTestEnv is true during keep VM trigger - if CurrentSpecReport().Failed() { - if keepTestEnv { - AbortSuite("e2e test aborted and skip cleaning the VM", 4) - } - } DumpSpecResourcesAndCleanup(ctx, specName, bootstrapClusterProxy, artifactFolder, namespace, e2eConfig.GetIntervals, clusterName, clusterctlLogFolder, skipCleanup) }) }) diff --git a/test/e2e/live_iso_test.go b/test/e2e/live_iso_test.go index 448d30fd7d..949b4a0cf3 100644 --- a/test/e2e/live_iso_test.go +++ b/test/e2e/live_iso_test.go @@ -101,12 +101,6 @@ func liveIsoTest() { }) AfterEach(func() { - // Abort the test in case of failure and keepTestEnv is true during keep VM trigger - if CurrentSpecReport().Failed() { - if keepTestEnv { - AbortSuite("e2e test aborted and skip cleaning the VM", 4) - } - } By("Deprovisioning live ISO image booted BMH") bootstrapClient := bootstrapClusterProxy.GetClient() diff --git a/test/e2e/pivoting_based_feature_test.go b/test/e2e/pivoting_based_feature_test.go index 72524ecdbe..6abb98908b 100644 --- a/test/e2e/pivoting_based_feature_test.go +++ b/test/e2e/pivoting_based_feature_test.go @@ -143,12 +143,6 @@ var _ = Describe("Testing features in ephemeral or target cluster [pivoting] [fe ListMachines(ctx, targetCluster.GetClient(), client.InNamespace(namespace)) } ListNodes(ctx, targetCluster.GetClient()) - // Abort the test in case of failure and keepTestEnv is true during keep VM trigger - if CurrentSpecReport().Failed() { - if keepTestEnv { - AbortSuite("e2e test aborted and skip cleaning the VM", 4) - } - } if !ephemeralTest { // Dump the target cluster resources before re-pivoting. Logf("Dump the target cluster resources before re-pivoting") diff --git a/test/e2e/remediation_based_feature_test.go b/test/e2e/remediation_based_feature_test.go index 5f9b3e8a14..774bbf95a4 100644 --- a/test/e2e/remediation_based_feature_test.go +++ b/test/e2e/remediation_based_feature_test.go @@ -111,12 +111,6 @@ var _ = Describe("Testing nodes remediation [remediation] [features]", Label("re ListMetal3Machines(ctx, bootstrapClusterProxy.GetClient(), client.InNamespace(namespace)) ListMachines(ctx, bootstrapClusterProxy.GetClient(), client.InNamespace(namespace)) ListNodes(ctx, targetCluster.GetClient()) - // Abort the test in case of failure and keepTestEnv is true during keep VM trigger - if CurrentSpecReport().Failed() { - if keepTestEnv { - AbortSuite("e2e test aborted and skip cleaning the VM", 4) - } - } DumpSpecResourcesAndCleanup(ctx, specName, bootstrapClusterProxy, artifactFolder, namespace, e2eConfig.GetIntervals, clusterName, clusterctlLogFolder, skipCleanup) }) diff --git a/test/e2e/upgrade_clusterctl_test.go b/test/e2e/upgrade_clusterctl_test.go index e54eab4c85..b267427e37 100644 --- a/test/e2e/upgrade_clusterctl_test.go +++ b/test/e2e/upgrade_clusterctl_test.go @@ -328,7 +328,6 @@ func preUpgrade(clusterProxy framework.ClusterProxy) { // preCleanupManagementCluster hook should be called from ClusterctlUpgradeSpec before cleaning the target management cluster // it moves back Ironic to the bootstrap cluster. func preCleanupManagementCluster(clusterProxy framework.ClusterProxy) { - // Abort the test in case of failure and keepTestEnv is true during keep VM trigger if CurrentSpecReport().Failed() { // Fetch logs in case of failure in management cluster By("Fetch logs from management cluster") @@ -341,10 +340,6 @@ func preCleanupManagementCluster(clusterProxy framework.ClusterProxy) { if len(errorData) > 0 { Logf("Error of the shell: %v\n", string(errorData)) } - - if keepTestEnv { - AbortSuite("e2e test aborted and skip cleaning the VM", 4) - } } // Fetch logs from management cluster By("Fetch logs from management cluster") diff --git a/test/e2e/upgrade_kubernetes_test.go b/test/e2e/upgrade_kubernetes_test.go index 0eaab918e5..ce4fa55145 100644 --- a/test/e2e/upgrade_kubernetes_test.go +++ b/test/e2e/upgrade_kubernetes_test.go @@ -60,12 +60,6 @@ var _ = Describe("Kubernetes version upgrade in target nodes [k8s-upgrade]", Lab ListMetal3Machines(ctx, bootstrapClusterProxy.GetClient(), client.InNamespace(namespace)) ListMachines(ctx, bootstrapClusterProxy.GetClient(), client.InNamespace(namespace)) ListNodes(ctx, targetCluster.GetClient()) - // // Abort the test in case of failure and keepTestEnv is true during keep VM trigger - if CurrentSpecReport().Failed() { - if keepTestEnv { - AbortSuite("e2e test aborted and skip cleaning the VM", 4) - } - } DumpSpecResourcesAndCleanup(ctx, specName, bootstrapClusterProxy, artifactFolder, namespace, e2eConfig.GetIntervals, clusterName, clusterctlLogFolder, skipCleanup) })