From 6dd0cbfaddc8ac795fb084053dae798803f22ec9 Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 3 Nov 2023 18:46:54 +0000 Subject: [PATCH] tests/int: Set exit code 1 on tf destroy fail Explicitly set the test program exit code to 1 when terraform destroy fails to delete the infrastructure. This was observed when GKE clusters failed to delete due to delete protection enabled by default in the latest version of terraform provider google. Signed-off-by: Sunny --- tests/integration/suite_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/suite_test.go b/tests/integration/suite_test.go index b6ee358934..8044c46cbc 100644 --- a/tests/integration/suite_test.go +++ b/tests/integration/suite_test.go @@ -220,6 +220,7 @@ func TestMain(m *testing.M) { defer func() { if err := testEnv.Stop(ctx); err != nil { log.Printf("Failed to stop environment: %v", err) + exitCode = 1 } // Log the panic error before exit to surface the cause of panic.