Skip to content

Commit

Permalink
Test exclude disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
denis256 committed Nov 15, 2024
1 parent eae8e3b commit d05d576
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
Empty file.
Empty file.
Empty file.
5 changes: 5 additions & 0 deletions test/fixtures/exclude/exclude-disabled/app2/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exclude {
if = false
actions = ["all"]
exclude_dependencies = true
}
16 changes: 16 additions & 0 deletions test/integration_exclude_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

const (
testExcludeByDefault = "fixtures/exclude/exclude-default"
testExcludeDisabled = "fixtures/exclude/exclude-disabled"
)

func TestExcludeByDefault(t *testing.T) {
Expand All @@ -27,3 +28,18 @@ func TestExcludeByDefault(t *testing.T) {
assert.Contains(t, stderr, "app1")
assert.NotContains(t, stderr, "app2")
}

func TestExcludeDisabled(t *testing.T) {
t.Parallel()

cleanupTerraformFolder(t, testExcludeDisabled)
tmpEnvPath := helpers.CopyEnvironment(t, testExcludeDisabled)
rootPath := util.JoinPath(tmpEnvPath, testExcludeDisabled)

_, stderr, err := helpers.RunTerragruntCommandWithOutput(t, "terragrunt run-all apply -auto-approve --terragrunt-non-interactive --terragrunt-working-dir "+rootPath)

require.NoError(t, err)

assert.Contains(t, stderr, "app1")
assert.Contains(t, stderr, "app2")
}

0 comments on commit d05d576

Please sign in to comment.