Skip to content

Commit e0888b4

Browse files
committed
Add integration test, no execution yet
1 parent e9d467b commit e0888b4

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
resource "null_resource" "tf_retryable_error" {
2+
provisioner "local-exec" {
3+
command = "if [[ -f terraform.tfstate.backup ]]; then exit 0; else echo 'Error: Error loading modules: module foo: not found, mayx need to run 'terraform init'' && exit 1; fi"
4+
interpreter = ["/bin/bash", "-c"]
5+
}
6+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terragrunt = {}

test/integration_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const (
7373
TEST_FIXTURE_HOOKS_INIT_ONCE_WITH_SOURCE_WITH_BACKEND = "fixture-hooks/init-once/with-source-with-backend"
7474
TEST_FIXTURE_FAILED_TERRAFORM = "fixture-failure"
7575
TEST_FIXTURE_EXIT_CODE = "fixture-exit-code"
76+
TEST_FIXTURE_AUTO_RETRY_RERUN = "fixture-auto-retry/re-run"
7677
TERRAFORM_FOLDER = ".terraform"
7778
TERRAFORM_STATE = "terraform.tfstate"
7879
TERRAFORM_STATE_BACKUP = "terraform.tfstate.backup"
@@ -839,6 +840,19 @@ func TestPriorityOrderOfArgument(t *testing.T) {
839840
assert.Contains(t, out.String(), fmt.Sprintf("test = %s", injectedValue))
840841
}
841842

843+
//func TestAutoRetryRerun(t *testing.T) {
844+
// t.Parallel()
845+
//
846+
// out := new(bytes.Buffer)
847+
// rootPath := copyEnvironment(t, TEST_FIXTURE_AUTO_RETRY_RERUN)
848+
// modulePath := util.JoinPath(rootPath, TEST_FIXTURE_AUTO_RETRY_RERUN)
849+
// err := runTerragruntCommand(t, fmt.Sprintf("terragrunt apply --auto-approve --terragrunt-non-interactive --terragrunt-working-dir %s", modulePath), out, os.Stderr)
850+
//
851+
// assert.Nil(t, err)
852+
// // t.Log(out)
853+
// assert.NotContains(t, out.String(), "may need to run 'terraform init'")
854+
//}
855+
842856
// This tests terragrunt properly passes through terraform commands and any number of specified args
843857
func TestTerraformCommandCliArgs(t *testing.T) {
844858
t.Parallel()

0 commit comments

Comments
 (0)