Skip to content

Commit 0b18393

Browse files
authored
fix: discovery of hidden directories (#4945)
* chore: add test to track that hidden directories are included in queue dir * docs: updated queue-include documentation to include hidden directories * Lint issues * Discovery of hidden dirs * PR cleanup
1 parent 7c900a3 commit 0b18393

File tree

6 files changed

+27
-0
lines changed

6 files changed

+27
-0
lines changed

internal/runner/runnerpool/builder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func Build(
2828
d := discovery.
2929
NewDiscovery(workingDir).
3030
WithOptions(opts...).
31+
WithHidden().
3132
WithDiscoverExternalDependencies().
3233
WithParseInclude().
3334
WithParseExclude().
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "text" {
2+
value = "hidden1"
3+
}
4+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "text" {
2+
value = "hidden2"
3+
}
4+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

test/integration_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ const (
115115
testFixtureTraceParent = "fixtures/trace-parent"
116116
testFixtureVersionInvocation = "fixtures/version-invocation"
117117
testFixtureVersionFilesCacheKey = "fixtures/version-files-cache-key"
118+
hiddenRunAllFixturePath = "fixtures/hidden-runall"
118119

119120
terraformFolder = ".terraform"
120121

@@ -4394,3 +4395,18 @@ output "result" {
43944395
`There is no variable named "dependency".`,
43954396
)
43964397
}
4398+
4399+
func TestRunAllDetectsHiddenDirectories(t *testing.T) {
4400+
t.Parallel()
4401+
rootPath := helpers.CopyEnvironment(t, hiddenRunAllFixturePath, ".cloud/**")
4402+
modulePath := util.JoinPath(rootPath, hiddenRunAllFixturePath)
4403+
helpers.CleanupTerraformFolder(t, modulePath)
4404+
4405+
// Expect Terragrunt to discover modules under .cloud directory
4406+
command := "terragrunt run --all plan --non-interactive --log-level trace --working-dir " + modulePath
4407+
stdout, _, err := helpers.RunTerragruntCommandWithOutput(t, command)
4408+
4409+
require.NoError(t, err)
4410+
assert.Contains(t, stdout, "hidden1")
4411+
assert.Contains(t, stdout, "hidden2")
4412+
}

0 commit comments

Comments
 (0)