paralleltest: add tests of the ignore-missing option (#3233)
This commit is contained in:
parent
ac95c85fe6
commit
05c3af1ad5
@ -23,7 +23,7 @@ func NewParallelTest(settings *config.ParallelTestSettings) *goanalysis.Linter {
|
|||||||
return goanalysis.NewLinter(
|
return goanalysis.NewLinter(
|
||||||
"paralleltest",
|
"paralleltest",
|
||||||
"paralleltest detects missing usage of t.Parallel() method in your Go test",
|
"paralleltest detects missing usage of t.Parallel() method in your Go test",
|
||||||
[]*analysis.Analyzer{paralleltest.Analyzer},
|
[]*analysis.Analyzer{a},
|
||||||
cfg,
|
cfg,
|
||||||
).WithLoadMode(goanalysis.LoadModeTypesInfo)
|
).WithLoadMode(goanalysis.LoadModeTypesInfo)
|
||||||
}
|
}
|
||||||
|
3
test/testdata/configs/paralleltest.yml
vendored
Normal file
3
test/testdata/configs/paralleltest.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
linters-settings:
|
||||||
|
paralleltest:
|
||||||
|
ignore-missing: true
|
24
test/testdata/paralleltest_custom.go
vendored
Normal file
24
test/testdata/paralleltest_custom.go
vendored
Normal 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) {}
|
Loading…
x
Reference in New Issue
Block a user