Skip to content

Commit

Permalink
tests/int: Set exit code 1 on tf destroy fail
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
darkowlzz committed Nov 3, 2023
1 parent e7c015d commit 6dd0cbf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6dd0cbf

Please sign in to comment.