@@ -47,6 +47,7 @@ const (
47
47
testFixtureStackSelfInclude = "fixtures/stacks/self-include"
48
48
testFixtureStackNestedOutputs = "fixtures/stacks/nested-outputs"
49
49
testFixtureStackNoValidation = "fixtures/stacks/no-validation"
50
+ testFixtureStackTerragruntDir = "fixtures/stacks/terragrunt-dir"
50
51
)
51
52
52
53
func TestStacksGenerateBasic (t * testing.T ) {
@@ -249,32 +250,6 @@ func TestStacksApplyClean(t *testing.T) {
249
250
assert .NoDirExists (t , path )
250
251
}
251
252
252
- func TestStackCleanRecursively (t * testing.T ) {
253
- t .Parallel ()
254
-
255
- helpers .CleanupTerraformFolder (t , testFixtureNestedStacks )
256
- tmpEnvPath := helpers .CopyEnvironment (t , testFixtureNestedStacks )
257
- gitPath := util .JoinPath (tmpEnvPath , testFixtureNestedStacks )
258
- helpers .CreateGitRepo (t , gitPath )
259
- live := util .JoinPath (gitPath , "live" )
260
-
261
- _ , _ , err := helpers .RunTerragruntCommandWithOutput (t , "terragrunt stack generate --working-dir " + live )
262
- require .NoError (t , err )
263
-
264
- liveV2 := util .JoinPath (gitPath , "live-v2" )
265
- _ , _ , err = helpers .RunTerragruntCommandWithOutput (t , "terragrunt stack generate --working-dir " + liveV2 )
266
- require .NoError (t , err )
267
-
268
- _ , stderr , err := helpers .RunTerragruntCommandWithOutput (t , "terragrunt stack clean --working-dir " + gitPath )
269
- require .NoError (t , err )
270
-
271
- assert .NoDirExists (t , util .JoinPath (live , ".terragrunt-stack" ))
272
- assert .NoDirExists (t , util .JoinPath (liveV2 , ".terragrunt-stack" ))
273
-
274
- assert .Contains (t , stderr , "Deleting stack directory: live/.terragrunt-stack" )
275
- assert .Contains (t , stderr , "Deleting stack directory: live-v2/.terragrunt-stack" )
276
- }
277
-
278
253
func TestStacksDestroy (t * testing.T ) {
279
254
t .Parallel ()
280
255
@@ -1275,3 +1250,20 @@ func validateStackDir(t *testing.T, path string) {
1275
1250
1276
1251
assert .True (t , hasSubdirectories , "The .terragrunt-stack directory should contain at least one subdirectory" )
1277
1252
}
1253
+
1254
+ func TestStackTerragruntDir (t * testing.T ) {
1255
+ t .Parallel ()
1256
+
1257
+ helpers .CleanupTerraformFolder (t , testFixtureStackTerragruntDir )
1258
+ tmpEnvPath := helpers .CopyEnvironment (t , testFixtureStackTerragruntDir )
1259
+ gitPath := util .JoinPath (tmpEnvPath , testFixtureStackTerragruntDir )
1260
+ helpers .CreateGitRepo (t , gitPath )
1261
+ rootPath := util .JoinPath (gitPath , "live" )
1262
+
1263
+ _ , _ , err := helpers .RunTerragruntCommandWithOutput (t , "terragrunt stack generate --no-stack-validate --working-dir " + rootPath )
1264
+ require .NoError (t , err )
1265
+
1266
+ out , _ , err := helpers .RunTerragruntCommandWithOutput (t , "terragrunt apply --all --non-interactive --working-dir " + rootPath )
1267
+ require .NoError (t , err )
1268
+ assert .Contains (t , out , `terragrunt_dir = "./tennant_1"` )
1269
+ }
0 commit comments