test: Allow fix tests to run concurrently (#1576)
This commit is contained in:
parent
f00da2c0b7
commit
eace6a11a9
@ -27,7 +27,9 @@ func TestFix(t *testing.T) {
|
|||||||
if os.Getenv("GL_KEEP_TEMP_FILES") == "1" {
|
if os.Getenv("GL_KEEP_TEMP_FILES") == "1" {
|
||||||
t.Logf("Temp dir for fix test: %s", tmpDir)
|
t.Logf("Temp dir for fix test: %s", tmpDir)
|
||||||
} else {
|
} else {
|
||||||
defer os.RemoveAll(tmpDir)
|
t.Cleanup(func() {
|
||||||
|
os.RemoveAll(tmpDir)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fixDir := filepath.Join(testdataDir, "fix")
|
fixDir := filepath.Join(testdataDir, "fix")
|
||||||
@ -38,9 +40,11 @@ func TestFix(t *testing.T) {
|
|||||||
for _, input := range inputs {
|
for _, input := range inputs {
|
||||||
input := input
|
input := input
|
||||||
t.Run(filepath.Base(input), func(t *testing.T) {
|
t.Run(filepath.Base(input), func(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
"--disable-all", "--print-issued-lines=false", "--print-linter-name=false", "--out-format=line-number",
|
"--disable-all", "--print-issued-lines=false", "--print-linter-name=false", "--out-format=line-number",
|
||||||
"--fix",
|
"--allow-parallel-runners", "--fix",
|
||||||
input,
|
input,
|
||||||
}
|
}
|
||||||
rc := extractRunContextFromComments(t, input)
|
rc := extractRunContextFromComments(t, input)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user