From 95c1e9f2c564dd2a788e1e1d6c563746a6e9b90c Mon Sep 17 00:00:00 2001 From: zjhe Date: Fri, 30 Dec 2022 14:13:30 +0800 Subject: [PATCH] add error check for destroy --- e2etest.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2etest.go b/e2etest.go index 69618f1..3c14948 100644 --- a/e2etest.go +++ b/e2etest.go @@ -1,6 +1,7 @@ package terraform_module_test_helper import ( + "github.com/stretchr/testify/require" "testing" "time" @@ -34,7 +35,8 @@ func destroy(t *testing.T, option terraform.Options) { option.RetryableTerraformErrors = map[string]string{ ".*": "Retry destroy on any error", } - terraform.RunTerraformCommand(t, &option, terraform.FormatArgs(&option, "destroy", "-auto-approve", "-input=false", "-refresh=false")...) + _, err := terraform.RunTerraformCommandE(t, &option, terraform.FormatArgs(&option, "destroy", "-auto-approve", "-input=false", "-refresh=false")...) + require.NoError(t, err) } func removeLogger(option terraform.Options) *terraform.Options {