Skip to content

Commit

Permalink
Merge pull request #1624 from Nordix/remove/keep-env
Browse files Browse the repository at this point in the history
🌱 Remove keep test env related vars and configs
  • Loading branch information
metal3-io-bot authored Apr 25, 2024
2 parents b656b48 + 73b217e commit 77625f9
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 42 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down
4 changes: 0 additions & 4 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)")
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/ip_reuse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
6 changes: 0 additions & 6 deletions test/e2e/live_iso_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/pivoting_based_feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/remediation_based_feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand Down
5 changes: 0 additions & 5 deletions test/e2e/upgrade_clusterctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/upgrade_kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand Down

0 comments on commit 77625f9

Please sign in to comment.