Skip to content

Commit fe60c83

Browse files
authored
ci: unleash the paralleltest lints (#252)
1 parent 4e701a5 commit fe60c83

File tree

7 files changed

+29
-1
lines changed

7 files changed

+29
-1
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ linters:
1515
- makezero
1616
- misspell
1717
- nilerr
18-
# - paralleltest # Reference: https://github.com/kunwardeep/paralleltest/issues/14
18+
- paralleltest
1919
- predeclared
2020
- staticcheck
2121
- tenv

tfprotov5/internal/toproto/diagnostic_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
)
66

77
func TestForceValidUTF8(t *testing.T) {
8+
t.Parallel()
9+
810
tests := []struct {
911
Input string
1012
Want string
@@ -48,7 +50,10 @@ func TestForceValidUTF8(t *testing.T) {
4850
}
4951

5052
for _, test := range tests {
53+
test := test
5154
t.Run(test.Input, func(t *testing.T) {
55+
t.Parallel()
56+
5257
got := forceValidUTF8(test.Input)
5358
if got != test.Want {
5459
t.Errorf("wrong result\ngot: %q\nwant: %q", got, test.Want)

tfprotov6/internal/toproto/diagnostic_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
)
66

77
func TestForceValidUTF8(t *testing.T) {
8+
t.Parallel()
9+
810
tests := []struct {
911
Input string
1012
Want string
@@ -48,7 +50,10 @@ func TestForceValidUTF8(t *testing.T) {
4850
}
4951

5052
for _, test := range tests {
53+
test := test
5154
t.Run(test.Input, func(t *testing.T) {
55+
t.Parallel()
56+
5257
got := forceValidUTF8(test.Input)
5358
if got != test.Want {
5459
t.Errorf("wrong result\ngot: %q\nwant: %q", got, test.Want)

tftypes/primitive_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ func TestPrimitiveApplyTerraform5AttributePathStep(t *testing.T) {
134134
}
135135

136136
func TestPrimitiveEqual(t *testing.T) {
137+
t.Parallel()
138+
137139
type testCase struct {
138140
p1 primitive
139141
p2 primitive
@@ -154,6 +156,8 @@ func TestPrimitiveEqual(t *testing.T) {
154156
for name, tc := range tests {
155157
name, tc := name, tc
156158
t.Run(name, func(t *testing.T) {
159+
t.Parallel()
160+
157161
res := tc.p1.Equal(tc.p2)
158162
revRes := tc.p2.Equal(tc.p1)
159163
if res != revRes {
@@ -167,6 +171,8 @@ func TestPrimitiveEqual(t *testing.T) {
167171
}
168172

169173
func TestPrimitiveIs(t *testing.T) {
174+
t.Parallel()
175+
170176
type testCase struct {
171177
p1 primitive
172178
p2 primitive
@@ -187,6 +193,8 @@ func TestPrimitiveIs(t *testing.T) {
187193
for name, tc := range tests {
188194
name, tc := name, tc
189195
t.Run(name, func(t *testing.T) {
196+
t.Parallel()
197+
190198
res := tc.p1.Is(tc.p2)
191199
if res != tc.equal {
192200
t.Errorf("Expected result to be %v, got %v", tc.equal, res)
@@ -196,6 +204,8 @@ func TestPrimitiveIs(t *testing.T) {
196204
}
197205

198206
func TestPrimitiveUsableAs(t *testing.T) {
207+
t.Parallel()
208+
199209
type testCase struct {
200210
p primitive
201211
o Type

tftypes/type_json_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ func TestTypeJSON(t *testing.T) {
156156
for name, test := range testCases {
157157
name, test := name, test
158158
t.Run(name, func(t *testing.T) {
159+
t.Parallel()
160+
159161
typ, err := ParseJSONType([]byte(test.json))
160162
if err != nil {
161163
t.Fatalf("unexpected error parsing JSON: %s", err)

tftypes/value_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ func TestValueAs(t *testing.T) {
430430
for name, test := range tests {
431431
name, test := name, test
432432
t.Run(name, func(t *testing.T) {
433+
t.Parallel()
434+
433435
err := test.in.As(test.as)
434436
if err != nil {
435437
t.Fatalf("unexpected error: %s", err)
@@ -1747,6 +1749,8 @@ func TestValueString(t *testing.T) {
17471749
for name, test := range tests {
17481750
name, test := name, test
17491751
t.Run(name, func(t *testing.T) {
1752+
t.Parallel()
1753+
17501754
str := test.in.String()
17511755
if diff := cmp.Diff(test.expected, str); diff != "" {
17521756
t.Errorf("Unexpected results (-wanted, +got): %s", diff)

tftypes/walk_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import (
3232
)
3333

3434
func TestWalk(t *testing.T) {
35+
t.Parallel()
36+
3537
valType := Object{
3638
AttributeTypes: map[string]Type{
3739
"string": String,

0 commit comments

Comments
 (0)