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 <darkowlzz@protonmail.com>
This commit is contained in:
Sunny 2023-11-03 18:46:54 +00:00
parent e7c015d24c
commit 6dd0cbfadd
No known key found for this signature in database
GPG key ID: C58440AB02208FDD

View file

@ -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.