File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -415,13 +415,23 @@ func (e *Executor) setupExitCode(ctx context.Context) {
415415 if ctx .Err () != nil {
416416 e .exitCode = exitcodes .Timeout
417417 e .log .Errorf ("Deadline exceeded: try increase it by passing --deadline option" )
418+ return
418419 }
419420
420- if e .exitCode == exitcodes .Success &&
421- ( os . Getenv ( "GL_TEST_RUN" ) == "1" || os . Getenv ( "FAIL_ON_WARNINGS" ) == "1" ) &&
422- len ( e . reportData . Warnings ) != 0 {
421+ if e .exitCode != exitcodes .Success {
422+ return
423+ }
423424
425+ needFailOnWarnings := (os .Getenv ("GL_TEST_RUN" ) == "1" || os .Getenv ("FAIL_ON_WARNINGS" ) == "1" )
426+ if needFailOnWarnings && len (e .reportData .Warnings ) != 0 {
424427 e .exitCode = exitcodes .WarningInTest
428+ return
429+ }
430+
431+ if e .reportData .Error != "" {
432+ // it's a case e.g. when typecheck linter couldn't parse and error and just logged it
433+ e .exitCode = exitcodes .ErrorWasLogged
434+ return
425435 }
426436}
427437
Original file line number Diff line number Diff line change 88 Timeout = 4
99 NoGoFiles = 5
1010 NoConfigFileDetected = 6
11+ ErrorWasLogged = 7
1112)
1213
1314type ExitError struct {
You can’t perform that action at this time.
0 commit comments