Skip to content

Commit d53d3a4

Browse files
committed
tests cleanup
1 parent 7390fce commit d53d3a4

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

internal/remotestate/backend/gcs/config.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
package gcs
22

33
import (
4+
"maps"
45
"reflect"
6+
"slices"
57
"strconv"
68

79
"github.com/gruntwork-io/terragrunt/internal/errors"
810
"github.com/gruntwork-io/terragrunt/internal/remotestate/backend"
911
"github.com/gruntwork-io/terragrunt/internal/util"
1012
"github.com/gruntwork-io/terragrunt/pkg/log"
1113
"github.com/mitchellh/mapstructure"
12-
"golang.org/x/exp/slices"
13-
14-
"maps"
1514
)
1615

1716
type Config map[string]any

internal/remotestate/backend/gcs/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package gcs_test
33
import (
44
"testing"
55

6-
gcs "github.com/gruntwork-io/terragrunt/internal/remotestate/backend/gcs"
6+
"github.com/gruntwork-io/terragrunt/internal/remotestate/backend/gcs"
77
"github.com/gruntwork-io/terragrunt/test/helpers/logger"
88
"github.com/stretchr/testify/assert"
99
"github.com/stretchr/testify/require"

internal/remotestate/backend/s3/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package s3
22

33
import (
4+
"maps"
45
"reflect"
56
"slices"
67

@@ -9,8 +10,6 @@ import (
910
"github.com/gruntwork-io/terragrunt/internal/util"
1011
"github.com/gruntwork-io/terragrunt/pkg/log"
1112
"github.com/mitchellh/mapstructure"
12-
13-
"maps"
1413
)
1514

1615
const (

internal/remotestate/backend/s3/config_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55

66
s3backend "github.com/gruntwork-io/terragrunt/internal/remotestate/backend/s3"
7-
"github.com/gruntwork-io/terragrunt/pkg/log"
7+
"github.com/gruntwork-io/terragrunt/test/helpers/logger"
88
"github.com/stretchr/testify/assert"
99
"github.com/stretchr/testify/require"
1010
)
@@ -104,7 +104,7 @@ func TestParseExtendedS3Config_StringBoolCoercion(t *testing.T) {
104104
t.Run(tc.name, func(t *testing.T) {
105105
t.Parallel()
106106

107-
extS3Cfg, err := tc.config.Normalize(log.Default()).ParseExtendedS3Config()
107+
extS3Cfg, err := tc.config.Normalize(logger.CreateLogger()).ParseExtendedS3Config()
108108
require.NoError(t, err)
109109

110110
tc.check(t, extS3Cfg)
@@ -124,6 +124,6 @@ func TestParseExtendedS3Config_InvalidStringBool(t *testing.T) {
124124
"use_lockfile": "maybe",
125125
}
126126

127-
_, err := cfg.Normalize(log.Default()).ParseExtendedS3Config()
127+
_, err := cfg.Normalize(logger.CreateLogger()).ParseExtendedS3Config()
128128
require.Error(t, err)
129129
}

internal/remotestate/remote_state_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,19 @@ func TestGetTFInitArgs_StringBoolCoercion(t *testing.T) {
190190
"-backend-config=use_lockfile=false",
191191
},
192192
},
193+
{
194+
"gcs-string-bool-skip-versioning",
195+
"gcs",
196+
map[string]any{
197+
"bucket": "my-bucket",
198+
"prefix": "terraform.tfstate",
199+
"skip_bucket_versioning": "true",
200+
},
201+
[]string{
202+
"-backend-config=bucket=my-bucket",
203+
"-backend-config=prefix=terraform.tfstate",
204+
},
205+
},
193206
}
194207

195208
for _, tc := range testCases {

0 commit comments

Comments
 (0)