Skip to content

Commit 538fb13

Browse files
committed
wip: debug windows
1 parent e01da53 commit 538fb13

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

test/run_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ func TestAutogeneratedNoIssues(t *testing.T) {
2727
WithTargetPath(testdataDir, "autogenerated").
2828
WithBinPath(binPath).
2929
Runner().
30-
Install().
3130
Run().
3231
ExpectNoIssues()
3332
}
@@ -328,18 +327,19 @@ func TestUnsafeOk(t *testing.T) {
328327

329328
cfg := `
330329
linters:
330+
enable-all: true
331331
exclusions:
332332
presets:
333333
- commonFalsePositives
334334
`
335335

336336
testshared.NewRunnerBuilder(t).
337337
WithConfig(cfg).
338-
WithArgs("--enable-all").
339338
WithTargetPath(testdataDir, "unsafe").
340339
WithBinPath(binPath).
341340
Runner().
342341
Run().
342+
TrimForWindows().
343343
ExpectNoIssues()
344344
}
345345

test/testshared/runner.go

+16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"os"
55
"os/exec"
66
"path/filepath"
7+
"regexp"
8+
"runtime"
79
"strings"
810
"sync"
911
"syscall"
@@ -283,6 +285,20 @@ func (r *RunnerResult) ExpectNoIssues() {
283285
assert.Equal(r.tb, exitcodes.Success, r.exitCode, "output is %s", r.output)
284286
}
285287

288+
func (r *RunnerResult) TrimForWindows() *RunnerResult {
289+
r.tb.Helper()
290+
291+
if runtime.GOOS != "windows" {
292+
return r
293+
}
294+
295+
exp := regexp.MustCompile(`level=warning msg="\[config_reader\] Can't pretty print config file path.+\s`)
296+
297+
r.output = exp.ReplaceAllString(r.output, "")
298+
299+
return r
300+
}
301+
286302
func (r *RunnerResult) ExpectExitCode(possibleCodes ...int) *RunnerResult {
287303
r.tb.Helper()
288304

0 commit comments

Comments
 (0)