Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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) {}