From 18bfb28c0b0bb4d7fd4c00a50a511175b531aa19 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Thu, 26 May 2022 10:59:50 +0900 Subject: [PATCH] e2e: ARC_E2E_NO_CLEANUP to prevent cleanup (#1470) A small improvement to our E2E test suite which allows you to set `ARC_E2E_NO_CLEANUP=whatever` to let it prevent the kind cluster cleanup on successful test run, so that you can rerun it without waiting for the new kind cluster to come up. --- test/e2e/e2e_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index f570c147..5c75521f 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -3,6 +3,7 @@ package e2e import ( "context" "fmt" + "os" "path/filepath" "strconv" "time" @@ -137,6 +138,10 @@ func TestE2E(t *testing.T) { t.Run("Verify workflow run result", func(t *testing.T) { env.verifyActionsWorkflowRun(t) }) + + if os.Getenv("ARC_E2E_NO_CLEANUP") != "" { + t.FailNow() + } } func TestE2ERunnerDeploy(t *testing.T) { @@ -179,7 +184,9 @@ func TestE2ERunnerDeploy(t *testing.T) { env.verifyActionsWorkflowRun(t) }) - t.FailNow() + if os.Getenv("ARC_E2E_NO_CLEANUP") != "" { + t.FailNow() + } } type env struct {