Skip to content

Commit 2cc930c

Browse files
committed
test/int: Set exit code 1 on tf destroy failure
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 <[email protected]>
1 parent 01d75b8 commit 2cc930c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/integration/suite_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func TestMain(m *testing.M) {
181181
defer func() {
182182
if err := testEnv.Stop(ctx); err != nil {
183183
log.Printf("Failed to stop environment: %v", err)
184+
exitCode = 1
184185
}
185186

186187
// Log the panic error before exit to surface the cause of panic.

0 commit comments

Comments
 (0)