@@ -10,15 +10,13 @@ import (
1010
1111 "github.com/gruntwork-io/terragrunt/internal/gcphelper"
1212 "github.com/gruntwork-io/terragrunt/pkg/options"
13- "github.com/gruntwork-io/terragrunt/test/helpers/logger"
1413 "github.com/stretchr/testify/assert"
1514 "github.com/stretchr/testify/require"
1615)
1716
1817func TestCreateGcpConfigWithApplicationCredentialsEnv (t * testing.T ) {
1918 t .Parallel ()
2019
21- l := logger .CreateLogger ()
2220 ctx := context .Background ()
2321
2422 // Create a temporary credentials file
@@ -33,15 +31,14 @@ func TestCreateGcpConfigWithApplicationCredentialsEnv(t *testing.T) {
3331 },
3432 }
3533
36- clientOpts , err := gcphelper .CreateGCPConfig (ctx , l , nil , opts )
34+ clientOpts , err := gcphelper .CreateGCPConfig (ctx , nil , opts )
3735 require .NoError (t , err )
3836 assert .NotEmpty (t , clientOpts )
3937}
4038
4139func TestCreateGcpConfigWithOAuthAccessTokenEnv (t * testing.T ) {
4240 t .Parallel ()
4341
44- l := logger .CreateLogger ()
4542 ctx := context .Background ()
4643
4744 opts := & options.TerragruntOptions {
@@ -50,15 +47,14 @@ func TestCreateGcpConfigWithOAuthAccessTokenEnv(t *testing.T) {
5047 },
5148 }
5249
53- clientOpts , err := gcphelper .CreateGCPConfig (ctx , l , nil , opts )
50+ clientOpts , err := gcphelper .CreateGCPConfig (ctx , nil , opts )
5451 require .NoError (t , err )
5552 assert .NotEmpty (t , clientOpts )
5653}
5754
5855func TestCreateGcpConfigWithGoogleCredentialsEnv (t * testing.T ) {
5956 t .Parallel ()
6057
61- l := logger .CreateLogger ()
6258 ctx := context .Background ()
6359
6460 // Test with JSON content directly (not a file path)
@@ -79,15 +75,14 @@ func TestCreateGcpConfigWithGoogleCredentialsEnv(t *testing.T) {
7975 },
8076 }
8177
82- clientOpts , err := gcphelper .CreateGCPConfig (ctx , l , nil , opts )
78+ clientOpts , err := gcphelper .CreateGCPConfig (ctx , nil , opts )
8379 require .NoError (t , err )
8480 assert .NotEmpty (t , clientOpts )
8581}
8682
8783func TestCreateGcpConfigWithCredentialsFileFromConfig (t * testing.T ) {
8884 t .Parallel ()
8985
90- l := logger .CreateLogger ()
9186 ctx := context .Background ()
9287
9388 // Create a temporary credentials file
@@ -104,15 +99,14 @@ func TestCreateGcpConfigWithCredentialsFileFromConfig(t *testing.T) {
10499 Credentials : credsFile ,
105100 }
106101
107- clientOpts , err := gcphelper .CreateGCPConfig (ctx , l , gcpCfg , opts )
102+ clientOpts , err := gcphelper .CreateGCPConfig (ctx , gcpCfg , opts )
108103 require .NoError (t , err )
109104 assert .NotEmpty (t , clientOpts )
110105}
111106
112107func TestCreateGcpConfigWithAccessTokenFromConfig (t * testing.T ) {
113108 t .Parallel ()
114109
115- l := logger .CreateLogger ()
116110 ctx := context .Background ()
117111
118112 opts := & options.TerragruntOptions {
@@ -123,15 +117,14 @@ func TestCreateGcpConfigWithAccessTokenFromConfig(t *testing.T) {
123117 AccessToken : "test-access-token" ,
124118 }
125119
126- clientOpts , err := gcphelper .CreateGCPConfig (ctx , l , gcpCfg , opts )
120+ clientOpts , err := gcphelper .CreateGCPConfig (ctx , gcpCfg , opts )
127121 require .NoError (t , err )
128122 assert .NotEmpty (t , clientOpts )
129123}
130124
131125func TestGcpConfigEnvVarsTakePrecedenceOverConfig (t * testing.T ) {
132126 t .Parallel ()
133127
134- l := logger .CreateLogger ()
135128 ctx := context .Background ()
136129
137130 // Create temporary credentials files
@@ -157,7 +150,7 @@ func TestGcpConfigEnvVarsTakePrecedenceOverConfig(t *testing.T) {
157150 Credentials : configCredsFile , // This should be ignored in favor of env var
158151 }
159152
160- clientOpts , err := gcphelper .CreateGCPConfig (ctx , l , gcpCfg , opts )
153+ clientOpts , err := gcphelper .CreateGCPConfig (ctx , gcpCfg , opts )
161154 require .NoError (t , err )
162155 assert .NotEmpty (t , clientOpts )
163156
@@ -168,7 +161,6 @@ func TestGcpConfigEnvVarsTakePrecedenceOverConfig(t *testing.T) {
168161func TestCreateGcpConfigWithImpersonation (t * testing.T ) {
169162 t .Parallel ()
170163
171- l := logger .CreateLogger ()
172164 ctx := context .Background ()
173165
174166 opts := & options.TerragruntOptions {
@@ -182,7 +174,7 @@ func TestCreateGcpConfigWithImpersonation(t *testing.T) {
182174
183175 // This will fail because we don't have real credentials, but we can verify
184176 // that the impersonation configuration is attempted
185- _ , err := gcphelper .CreateGCPConfig (ctx , l , gcpCfg , opts )
177+ _ , err := gcphelper .CreateGCPConfig (ctx , gcpCfg , opts )
186178 // We expect an error because impersonation requires valid base credentials
187179 // The error should be about impersonation, not about missing credentials
188180 require .Error (t , err )
@@ -192,15 +184,14 @@ func TestCreateGcpConfigWithImpersonation(t *testing.T) {
192184func TestCreateGcpConfigWithNoCredentials (t * testing.T ) {
193185 t .Parallel ()
194186
195- l := logger .CreateLogger ()
196187 ctx := context .Background ()
197188
198189 opts := & options.TerragruntOptions {
199190 Env : map [string ]string {},
200191 }
201192
202193 // No credentials provided - should return empty options (will use default credentials)
203- clientOpts , err := gcphelper .CreateGCPConfig (ctx , l , nil , opts )
194+ clientOpts , err := gcphelper .CreateGCPConfig (ctx , nil , opts )
204195 require .NoError (t , err )
205196 // Should return empty options when no credentials are provided
206197 // (default credentials will be used by GCP client)
@@ -210,7 +201,6 @@ func TestCreateGcpConfigWithNoCredentials(t *testing.T) {
210201func TestCreateGcpConfigWithGoogleCredentialsFile (t * testing.T ) {
211202 t .Parallel ()
212203
213- l := logger .CreateLogger ()
214204 ctx := context .Background ()
215205
216206 // Create a temporary credentials file
@@ -234,7 +224,7 @@ func TestCreateGcpConfigWithGoogleCredentialsFile(t *testing.T) {
234224 },
235225 }
236226
237- clientOpts , err := gcphelper .CreateGCPConfig (ctx , l , nil , opts )
227+ clientOpts , err := gcphelper .CreateGCPConfig (ctx , nil , opts )
238228 require .NoError (t , err )
239229 assert .NotEmpty (t , clientOpts )
240230}
0 commit comments