@@ -26,7 +26,6 @@ import (
2626 "github.com/gruntwork-io/terragrunt/pkg/log/format"
2727 "github.com/gruntwork-io/terragrunt/test/helpers/logger"
2828 "github.com/gruntwork-io/terragrunt/tf"
29- "github.com/gruntwork-io/terragrunt/util"
3029 "github.com/stretchr/testify/assert"
3130 "github.com/stretchr/testify/require"
3231)
@@ -54,23 +53,23 @@ func TestParseTerragruntOptionsFromArgs(t *testing.T) {
5453 }{
5554 {
5655 args : []string {"plan" },
57- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , false , defaultLogLevel , false ),
56+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , false , defaultLogLevel , false ),
5857 },
5958
6059 {
6160 args : []string {"plan" , "bar" },
62- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" , "bar" }, false , "" , false , false , defaultLogLevel , false ),
61+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" , "bar" }, false , "" , false , false , defaultLogLevel , false ),
6362 },
6463
6564 {
6665 args : []string {"--foo" , "--bar" },
67- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"-foo" , "-bar" }, false , "" , false , false , defaultLogLevel , false ),
66+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"-foo" , "-bar" }, false , "" , false , false , defaultLogLevel , false ),
6867 expectedErr : clipkg .UndefinedFlagError ("foo" ),
6968 },
7069
7170 {
7271 args : []string {"--foo" , "apply" , "--bar" },
73- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"apply" , "-foo" , "-bar" }, false , "" , false , false , defaultLogLevel , false ),
72+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"apply" , "-foo" , "-bar" }, false , "" , false , false , defaultLogLevel , false ),
7473 expectedErr : clipkg .UndefinedFlagError ("foo" ),
7574 },
7675
@@ -81,7 +80,7 @@ func TestParseTerragruntOptionsFromArgs(t *testing.T) {
8180
8281 {
8382 args : []string {"apply" , doubleDashed (shared .QueueIncludeExternalFlagName )},
84- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"apply" }, false , "" , false , true , defaultLogLevel , false ),
83+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"apply" }, false , "" , false , true , defaultLogLevel , false ),
8584 },
8685
8786 {
@@ -91,47 +90,47 @@ func TestParseTerragruntOptionsFromArgs(t *testing.T) {
9190
9291 {
9392 args : []string {"plan" , doubleDashed (global .WorkingDirFlagName ), "/some/path" },
94- expectedOptions : mockOptions (t , util . JoinPath ("/some/path" , config .DefaultTerragruntConfigPath ), "/some/path" , []string {"plan" }, false , "" , false , false , defaultLogLevel , false ),
93+ expectedOptions : mockOptions (t , filepath . Join ("/some/path" , config .DefaultTerragruntConfigPath ), "/some/path" , []string {"plan" }, false , "" , false , false , defaultLogLevel , false ),
9594 },
9695
9796 {
9897 args : []string {"plan" , doubleDashed (run .SourceFlagName ), "/some/path" },
99- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "/some/path" , false , false , defaultLogLevel , false ),
98+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "/some/path" , false , false , defaultLogLevel , false ),
10099 },
101100
102101 {
103102 args : []
string {
"plan" ,
doubleDashed (
run .
SourceMapFlagName ),
"git::[email protected] :one/gw-terraform-aws-vpc.git=git::[email protected] :two/test.git?ref=FEATURE" },
104- expectedOptions :
mockOptionsWithSourceMap (
t ,
util . JoinPath (
workingDir ,
config .
DefaultTerragruntConfigPath ),
workingDir , []
string {
"plan" },
map [
string ]
string {
"git::[email protected] :one/gw-terraform-aws-vpc.git" :
"git::[email protected] :two/test.git?ref=FEATURE" }),
103+ expectedOptions :
mockOptionsWithSourceMap (
t ,
filepath . Join (
workingDir ,
config .
DefaultTerragruntConfigPath ),
workingDir , []
string {
"plan" },
map [
string ]
string {
"git::[email protected] :one/gw-terraform-aws-vpc.git" :
"git::[email protected] :two/test.git?ref=FEATURE" }),
105104 },
106105
107106 {
108107 args : []string {"plan" , doubleDashed (shared .QueueIgnoreErrorsFlagName )},
109- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , true , false , defaultLogLevel , false ),
108+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , true , false , defaultLogLevel , false ),
110109 },
111110
112111 {
113112 args : []string {"plan" , doubleDashed (shared .QueueExcludeExternalFlagName )},
114- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , false , defaultLogLevel , false ),
113+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , false , defaultLogLevel , false ),
115114 },
116115
117116 {
118117 args : []string {"plan" , doubleDashed (run .IAMAssumeRoleFlagName ), "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME" },
119- expectedOptions : mockOptionsWithIamRole (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME" ),
118+ expectedOptions : mockOptionsWithIamRole (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME" ),
120119 },
121120
122121 {
123122 args : []string {"plan" , doubleDashed (run .IAMAssumeRoleDurationFlagName ), "36000" },
124- expectedOptions : mockOptionsWithIamAssumeRoleDuration (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , 36000 ),
123+ expectedOptions : mockOptionsWithIamAssumeRoleDuration (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , 36000 ),
125124 },
126125
127126 {
128127 args : []string {"plan" , doubleDashed (run .IAMAssumeRoleSessionNameFlagName ), "terragrunt-iam-role-session-name" },
129- expectedOptions : mockOptionsWithIamAssumeRoleSessionName (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , "terragrunt-iam-role-session-name" ),
128+ expectedOptions : mockOptionsWithIamAssumeRoleSessionName (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , "terragrunt-iam-role-session-name" ),
130129 },
131130
132131 {
133132 args : []string {"plan" , doubleDashed (run .IAMAssumeRoleWebIdentityTokenFlagName ), "web-identity-token" },
134- expectedOptions : mockOptionsWithIamWebIdentityToken (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , "web-identity-token" ),
133+ expectedOptions : mockOptionsWithIamWebIdentityToken (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , "web-identity-token" ),
135134 },
136135
137136 {
@@ -147,7 +146,7 @@ func TestParseTerragruntOptionsFromArgs(t *testing.T) {
147146 // Adding the --terragrunt-log-level flag should result in DebugLevel configured
148147 {
149148 args : []string {"plan" , doubleDashed (global .LogLevelFlagName ), "debug" },
150- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , false , log .DebugLevel , false ),
149+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , false , log .DebugLevel , false ),
151150 },
152151 {
153152 args : []string {"plan" , doubleDashed (run .ConfigFlagName )},
@@ -165,7 +164,7 @@ func TestParseTerragruntOptionsFromArgs(t *testing.T) {
165164 },
166165 {
167166 args : []string {"plan" , doubleDashed (run .InputsDebugFlagName )},
168- expectedOptions : mockOptions (t , util . JoinPath (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , false , defaultLogLevel , true ),
167+ expectedOptions : mockOptions (t , filepath . Join (workingDir , config .DefaultTerragruntConfigPath ), workingDir , []string {"plan" }, false , "" , false , false , defaultLogLevel , true ),
169168 },
170169 }
171170
0 commit comments