Skip to content

Commit 05c3af1

Browse files
authored
paralleltest: add tests of the ignore-missing option (#3233)
1 parent ac95c85 commit 05c3af1

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

pkg/golinters/paralleltest.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func NewParallelTest(settings *config.ParallelTestSettings) *goanalysis.Linter {
2323
return goanalysis.NewLinter(
2424
"paralleltest",
2525
"paralleltest detects missing usage of t.Parallel() method in your Go test",
26-
[]*analysis.Analyzer{paralleltest.Analyzer},
26+
[]*analysis.Analyzer{a},
2727
cfg,
2828
).WithLoadMode(goanalysis.LoadModeTypesInfo)
2929
}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
linters-settings:
2+
paralleltest:
3+
ignore-missing: true

test/testdata/paralleltest_custom.go

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//golangcitest:args -Eparalleltest
2+
//golangcitest:config_path testdata/configs/paralleltest.yml
3+
//golangcitest:expected_exitcode 0
4+
package testdata
5+
6+
import (
7+
"fmt"
8+
"testing"
9+
)
10+
11+
func TestParallelTestIgnore(t *testing.T) {
12+
testCases := []struct {
13+
name string
14+
}{{name: "foo"}}
15+
for _, tc := range testCases {
16+
tc := tc
17+
t.Run(tc.name, func(t *testing.T) {
18+
t.Parallel()
19+
fmt.Println(tc.name)
20+
})
21+
}
22+
}
23+
24+
func TestParallelTestEmptyIgnore(t *testing.T) {}

0 commit comments

Comments
 (0)