Skip to content

Commit

Permalink
paralleltest: add tests of the ignore-missing option (golangci#3233)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored and SeigeC committed Apr 4, 2023
1 parent 85f865f commit 3a4ae46
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/golinters/paralleltest.go
Expand Up @@ -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)
}
3 changes: 3 additions & 0 deletions test/testdata/configs/paralleltest.yml
@@ -0,0 +1,3 @@
linters-settings:
paralleltest:
ignore-missing: true
24 changes: 24 additions & 0 deletions test/testdata/paralleltest_custom.go
@@ -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) {}

0 comments on commit 3a4ae46

Please sign in to comment.