@@ -38,7 +38,8 @@ func TestStackDepsAutoIncludeGenerationAndDAG(t *testing.T) {
3838 helpers .CleanupTerraformFolder (t , testFixtureStackDepsAutoInclude )
3939 tmpEnvPath := helpers .CopyEnvironment (t , testFixtureStackDepsAutoInclude )
4040 liveDir := filepath .Join (tmpEnvPath , testFixtureStackDepsAutoInclude , "live" )
41- liveDir , _ = filepath .EvalSymlinks (liveDir )
41+ liveDir , err := filepath .EvalSymlinks (liveDir )
42+ require .NoError (t , err )
4243
4344 stackFile := filepath .Join (liveDir , "terragrunt.stack.hcl" )
4445
@@ -154,7 +155,8 @@ func TestStackDepsDAGExpandsStackToUnits(t *testing.T) {
154155 helpers .CleanupTerraformFolder (t , testFixtureStackDepsStackRef )
155156 tmpEnvPath := helpers .CopyEnvironment (t , testFixtureStackDepsStackRef )
156157 liveDir := filepath .Join (tmpEnvPath , testFixtureStackDepsStackRef , "live" )
157- liveDir , _ = filepath .EvalSymlinks (liveDir )
158+ liveDir , err := filepath .EvalSymlinks (liveDir )
159+ require .NoError (t , err )
158160
159161 stackFile := filepath .Join (liveDir , "terragrunt.stack.hcl" )
160162
@@ -274,6 +276,10 @@ func TestStackDepsE2EChain(t *testing.T) {
274276 assert .Equal (t , "unit-b received: from-c" , string (contentB ))
275277
276278 helpers .RunTerragrunt (t , "terragrunt run --all --non-interactive --experiment stack-dependencies --working-dir " + rootPath + " -- destroy -auto-approve" )
279+
280+ // Destroy must remove the marker files produced by apply.
281+ assert .NoFileExists (t , markerA [0 ])
282+ assert .NoFileExists (t , markerB [0 ])
277283}
278284
279285// TestStackDepsE2ECrossStack tests stack generation with cross-stack dependencies:
@@ -327,7 +333,8 @@ func TestStackDepsDocExample_UnitInStack(t *testing.T) {
327333 helpers .CleanupTerraformFolder (t , testFixtureStackDepsUnitInStack )
328334 tmpEnvPath := helpers .CopyEnvironment (t , testFixtureStackDepsUnitInStack )
329335 liveDir := filepath .Join (tmpEnvPath , testFixtureStackDepsUnitInStack , "live" )
330- liveDir , _ = filepath .EvalSymlinks (liveDir )
336+ liveDir , err := filepath .EvalSymlinks (liveDir )
337+ require .NoError (t , err )
331338
332339 stackFile := filepath .Join (liveDir , "terragrunt.stack.hcl" )
333340
@@ -373,7 +380,8 @@ func TestStackDepsDocExample_EntireStack(t *testing.T) {
373380 helpers .CleanupTerraformFolder (t , testFixtureStackDepsEntireStack )
374381 tmpEnvPath := helpers .CopyEnvironment (t , testFixtureStackDepsEntireStack )
375382 liveDir := filepath .Join (tmpEnvPath , testFixtureStackDepsEntireStack , "live" )
376- liveDir , _ = filepath .EvalSymlinks (liveDir )
383+ liveDir , err := filepath .EvalSymlinks (liveDir )
384+ require .NoError (t , err )
377385
378386 stackFile := filepath .Join (liveDir , "terragrunt.stack.hcl" )
379387
@@ -428,7 +436,8 @@ func TestStackDepsDocExample_NestedStackPath(t *testing.T) {
428436 helpers .CleanupTerraformFolder (t , testFixtureStackDepsNestedStack )
429437 tmpEnvPath := helpers .CopyEnvironment (t , testFixtureStackDepsNestedStack )
430438 liveDir := filepath .Join (tmpEnvPath , testFixtureStackDepsNestedStack , "live" )
431- liveDir , _ = filepath .EvalSymlinks (liveDir )
439+ liveDir , err := filepath .EvalSymlinks (liveDir )
440+ require .NoError (t , err )
432441
433442 stackFile := filepath .Join (liveDir , "terragrunt.stack.hcl" )
434443
@@ -507,6 +516,7 @@ func TestStackDepsFindJSON(t *testing.T) {
507516
508517 // Find the unit-w-inputs component and verify its dependency
509518 foundInputs := false
519+ foundOutputs := false
510520
511521 for _ , c := range components {
512522 if c .Type != "unit" {
@@ -521,11 +531,14 @@ func TestStackDepsFindJSON(t *testing.T) {
521531 }
522532
523533 if strings .HasSuffix (c .Path , "unit-w-outputs" ) {
534+ foundOutputs = true
535+
524536 assert .Empty (t , c .Dependencies )
525537 }
526538 }
527539
528540 require .True (t , foundInputs , "unit-w-inputs should be in find output" )
541+ require .True (t , foundOutputs , "unit-w-outputs should be in find output" )
529542}
530543
531544// TestStackDepsFindDAG verifies that terragrunt find --dag lists units in
@@ -807,4 +820,8 @@ func TestStackDepsE2ETree(t *testing.T) {
807820 assert .Equal (t , "unit-a(from-b(from-d,from-e),from-c)" , string (contentA ))
808821
809822 helpers .RunTerragrunt (t , "terragrunt run --all --non-interactive --experiment stack-dependencies --working-dir " + rootPath + " -- destroy -auto-approve" )
823+
824+ // Destroy must remove the marker files produced by apply.
825+ assert .NoFileExists (t , markerA [0 ])
826+ assert .NoFileExists (t , markerB [0 ])
810827}
0 commit comments