paralleltest: add tests of the ignore-missing option (#3233)

This commit is contained in:
Ludovic Fernandez 2022-09-23 10:06:10 +02:00 committed by GitHub
parent ac95c85fe6
commit 05c3af1ad5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 1 deletions

View File

@ -23,7 +23,7 @@ func NewParallelTest(settings *config.ParallelTestSettings) *goanalysis.Linter {
return goanalysis.NewLinter(
"paralleltest",
"paralleltest detects missing usage of t.Parallel() method in your Go test",
[]*analysis.Analyzer{paralleltest.Analyzer},
[]*analysis.Analyzer{a},
cfg,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}

View File

@ -0,0 +1,3 @@
linters-settings:
paralleltest:
ignore-missing: true

24
test/testdata/paralleltest_custom.go vendored Normal file
View File

@ -0,0 +1,24 @@
//golangcitest:args -Eparalleltest
//golangcitest:config_path testdata/configs/paralleltest.yml
//golangcitest:expected_exitcode 0
package testdata
import (
"fmt"
"testing"
)
func TestParallelTestIgnore(t *testing.T) {
testCases := []struct {
name string
}{{name: "foo"}}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
fmt.Println(tc.name)
})
}
}
func TestParallelTestEmptyIgnore(t *testing.T) {}