Skip to content

Commit

Permalink
fix: Adding explicit test for missing dependency (#3915)
Browse files Browse the repository at this point in the history
* fix: Adding explicit test for missing dependency

* fix: Clarify what we're testing here
  • Loading branch information
yhakbar authored Feb 21, 2025
1 parent 3613716 commit fb4b493
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
17 changes: 11 additions & 6 deletions test/fixtures/disabled/app/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
dependency "m1" {
config_path = "../m1"
dependency "unit_without_enabled" {
config_path = "../unit-without-enabled"
mock_outputs = {
"output1" = "mocked_output1"
}
}

dependency "m2" {
config_path = "../m2"
dependency "unit_disabled" {
config_path = "../unit-disabled"
enabled = false

mock_outputs = {
"output2" = "mocked_output2"
}
}

dependency "m3" {
config_path = "../m3"
dependency "unit_enabled" {
config_path = "../unit-enabled"
enabled = true

mock_outputs = {
"output3" = "mocked_output3"
}
}

dependency "unit_missing" {
config_path = "../unit-missing"
enabled = false
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3649,16 +3649,16 @@ func TestTerragruntDisabledDependency(t *testing.T) {

for _, path := range []string{
util.JoinPath(tmpEnvPath, testFixtureDisabledModule, "app"),
util.JoinPath(tmpEnvPath, testFixtureDisabledModule, "m1"),
util.JoinPath(tmpEnvPath, testFixtureDisabledModule, "m3"),
util.JoinPath(tmpEnvPath, testFixtureDisabledModule, "unit-without-enabled"),
util.JoinPath(tmpEnvPath, testFixtureDisabledModule, "unit-enabled"),
} {
relPath, err := filepath.Rel(testPath, path)
require.NoError(t, err)
assert.Contains(t, output, relPath, output)
}

for _, path := range []string{
util.JoinPath(tmpEnvPath, testFixtureDisabledModule, "m2"),
util.JoinPath(tmpEnvPath, testFixtureDisabledModule, "unit-disabled"),
} {
relPath, err := filepath.Rel(testPath, path)
require.NoError(t, err)
Expand Down

0 comments on commit fb4b493

Please sign in to comment.