@@ -10,6 +10,7 @@ import (
1010
1111 "github.com/gruntwork-io/go-commons/files"
1212 "github.com/gruntwork-io/go-commons/git"
13+ "github.com/gruntwork-io/go-commons/logging"
1314 "github.com/gruntwork-io/terratest/modules/environment"
1415 "github.com/stretchr/testify/assert"
1516 "github.com/stretchr/testify/require"
@@ -19,6 +20,10 @@ const (
1920 gitPATEnvName = "GITHUB_OAUTH_TOKEN"
2021)
2122
23+ var (
24+ logger = logging .GetLogger ("testlogger" )
25+ )
26+
2227// NOTE: All these tests should be run in the provided docker environment to avoid polluting the local git configuration
2328// settings. The tests will assert that it is running in the docker environment, and will fail if it is not.
2429
@@ -31,11 +36,11 @@ func TestHTTPSAuth(t *testing.T) {
3136
3237 environment .RequireEnvVar (t , gitPATEnvName )
3338 gitPAT := os .Getenv (gitPATEnvName )
34- require .NoError (t , git .ConfigureHTTPSAuth ("git" , gitPAT , "github.com" ))
39+ require .NoError (t , git .ConfigureHTTPSAuth (logger , "git" , gitPAT , "github.com" ))
3540
3641 tmpDir , err := ioutil .TempDir ("" , "git-test" )
3742 require .NoError (t , err )
38- require .NoError (t , git .Clone ("https://github.com/gruntwork-io/terraform-aws-lambda.git" , tmpDir ))
43+ require .NoError (t , git .Clone (logger , "https://github.com/gruntwork-io/terraform-aws-lambda.git" , tmpDir ))
3944 assert .True (t , files .IsDir (filepath .Join (tmpDir , "modules/lambda" )))
4045}
4146
@@ -48,11 +53,11 @@ func TestForceHTTPS(t *testing.T) {
4853
4954 environment .RequireEnvVar (t , gitPATEnvName )
5055 gitPAT := os .Getenv (gitPATEnvName )
51- require .NoError (t , git .ConfigureHTTPSAuth ("git" , gitPAT , "github.com" ))
52- require .NoError (t , git .ConfigureForceHTTPS ())
56+ require .NoError (t , git .ConfigureHTTPSAuth (logger , "git" , gitPAT , "github.com" ))
57+ require .NoError (t , git .ConfigureForceHTTPS (logger ))
5358
5459 tmpDir , err := ioutil .TempDir ("" , "git-test" )
5560 require .NoError (t , err )
56- require .NoError (t , git .Clone ("git@github.com:gruntwork-io/terraform-aws-lambda.git" , tmpDir ))
61+ require .NoError (t , git .Clone (logger , "git@github.com:gruntwork-io/terraform-aws-lambda.git" , tmpDir ))
5762 assert .True (t , files .IsDir (filepath .Join (tmpDir , "modules/lambda" )))
5863}
0 commit comments