Skip to content

Commit

Permalink
oci/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 c787787 commit d29d25f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions oci/tests/integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,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 d29d25f

Please sign in to comment.