Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ issues:
linters:
disable-all: true
enable:
- copyloopvar
- durationcheck
- errcheck
- exportloopref
- forcetypeassert
- gofmt
- gosimple
Expand All @@ -18,10 +18,10 @@ linters:
- paralleltest
- predeclared
- staticcheck
- tenv
- unconvert
- unparam
- unused
- usetesting
- govet

run:
Expand Down
2 changes: 0 additions & 2 deletions compare/values_differ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ func TestValuesDiffer_CompareValues(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions compare/values_same_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ func TestValuesSame_CompareValues(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions config/directory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ func TestTestStepConfigFunc_Exec_Directory(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions config/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ func TestTestStepConfigFunc_Exec_File(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
4 changes: 0 additions & 4 deletions config/variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ func TestMarshalJSON(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -321,8 +319,6 @@ func TestVariablesWrite(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
3 changes: 0 additions & 3 deletions helper/acctest/random_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ func TestRandSSHKeyPair(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -198,7 +196,6 @@ func TestInverseMask(t *testing.T) {
}

for tName, tCase := range testCases {
tName, tCase := tName, tCase
t.Run(tName, func(t *testing.T) {
t.Parallel()

Expand Down
6 changes: 0 additions & 6 deletions helper/resource/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ func TestProtoV5ProviderFactoriesMerge(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -154,8 +152,6 @@ func TestProtoV6ProviderFactoriesMerge(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -229,8 +225,6 @@ func TestSdkProviderFactoriesMerge(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions helper/resource/testcase_providers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ provider "test" {}`,
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
6 changes: 0 additions & 6 deletions helper/resource/testcase_validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ func TestTestCaseHasExternalProviders(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -104,8 +102,6 @@ func TestTestCaseHasProviders(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -184,8 +180,6 @@ func TestTestCaseValidate(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions helper/resource/testing_new_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1125,8 +1125,6 @@ func TestShimState(t *testing.T) {
}

for i, tc := range testCases {
i, tc := i, tc

t.Run(fmt.Sprintf("%d-%s", i, tc.Name), func(t *testing.T) {
t.Parallel()

Expand Down
4 changes: 0 additions & 4 deletions helper/resource/testing_sets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ func TestTestCheckTypeSetElemAttr(t *testing.T) {
}

for _, testCase := range testCases {
testCase := testCase

t.Run(testCase.Description, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -1010,7 +1009,6 @@ func TestTestCheckTypeSetElemAttrPair(t *testing.T) {
}

for _, testCase := range testCases {
testCase := testCase

t.Run(testCase.Description, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -1754,7 +1752,6 @@ func TestTestMatchTypeSetElemNestedAttrs(t *testing.T) {
}

for _, testCase := range testCases {
testCase := testCase

t.Run(testCase.Description, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -2593,7 +2590,6 @@ func TestTestCheckTypeSetElemNestedAttrs(t *testing.T) {
}

for _, testCase := range testCases {
testCase := testCase

t.Run(testCase.Description, func(t *testing.T) {
t.Parallel()
Expand Down
15 changes: 1 addition & 14 deletions helper/resource/testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func TestTest_Main(t *testing.T) {
for _, tc := range cases {
// reset sweepers
sweeperFuncs = map[string]*Sweeper{}
tc := tc

t.Run(tc.Name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -389,7 +389,6 @@ func TestFilterSweepers(t *testing.T) {
for _, tc := range cases {
// reset sweepers
sweeperFuncs = map[string]*Sweeper{}
tc := tc

t.Run(tc.Name, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -634,7 +633,6 @@ func TestFilterSweeperWithDependencies(t *testing.T) {
for _, tc := range cases {
// reset sweepers
sweeperFuncs = map[string]*Sweeper{}
tc := tc

t.Run(tc.Name, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -813,7 +811,6 @@ func TestRunSweepers(t *testing.T) {
for _, tc := range cases {
// reset sweepers
sweeperFuncs = map[string]*Sweeper{}
tc := tc

t.Run(tc.Name, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -1363,8 +1360,6 @@ func TestTestCheckResourceAttr(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1778,8 +1773,6 @@ func TestTestCheckResourceAttrWith(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -2000,8 +1993,6 @@ func TestTestCheckNoResourceAttr(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -2295,8 +2286,6 @@ func TestTestCheckResourceAttrPair(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -2431,8 +2420,6 @@ func TestTestCheckResourceAttrSet(t *testing.T) {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
8 changes: 0 additions & 8 deletions helper/resource/teststep_providers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,6 @@ resource "test_test" "test" {}
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1382,8 +1380,6 @@ resource "test_test" "test" {}
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1601,8 +1597,6 @@ provider "test" {}
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1856,8 +1850,6 @@ terraform {
}

for name, testCase := range testCases {
name, testCase := name, testCase

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
6 changes: 0 additions & 6 deletions helper/resource/teststep_validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ func TestTestStepHasExternalProviders(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -105,8 +103,6 @@ func TestTestStepHasProviders(t *testing.T) {
var stepIndex int

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -510,8 +506,6 @@ func TestTestStepValidate(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions helper/resource/tfversion_checks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ func TestRunTFVersionChecks(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions internal/configs/configschema/coerce_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,6 @@ func TestCoerceValue(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/configs/configschema/empty_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ func TestBlockEmptyValue(t *testing.T) {
}

for _, test := range tests {
test := test

t.Run(fmt.Sprintf("%#v", test.Schema), func(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 0 additions & 2 deletions internal/configs/configschema/implied_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ func TestBlockImpliedType(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
4 changes: 0 additions & 4 deletions internal/configs/hcl2shim/flatmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ func TestFlatmapValueFromHCL2(t *testing.T) {
}

for _, test := range tests {
test := test

t.Run(test.Value.GoString(), func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -312,7 +311,6 @@ func TestFlatmapValueFromHCL2FromFlatmap(t *testing.T) {
}

for _, test := range tests {
test := test

t.Run(test.Name, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -740,8 +738,6 @@ func TestHCL2ValueFromFlatmap(t *testing.T) {
}

for i, test := range tests {
i, test := i, test

t.Run(fmt.Sprintf("%d %#v as %#v", i, test.Flatmap, test.Type), func(t *testing.T) {
t.Parallel()

Expand Down
Loading
Loading