File tree 2 files changed +14
-3
lines changed
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) {
415
415
if ctx .Err () != nil {
416
416
e .exitCode = exitcodes .Timeout
417
417
e .log .Errorf ("Deadline exceeded: try increase it by passing --deadline option" )
418
+ return
418
419
}
419
420
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
+ }
423
424
425
+ needFailOnWarnings := (os .Getenv ("GL_TEST_RUN" ) == "1" || os .Getenv ("FAIL_ON_WARNINGS" ) == "1" )
426
+ if needFailOnWarnings && len (e .reportData .Warnings ) != 0 {
424
427
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
425
435
}
426
436
}
427
437
Original file line number Diff line number Diff line change 8
8
Timeout = 4
9
9
NoGoFiles = 5
10
10
NoConfigFileDetected = 6
11
+ ErrorWasLogged = 7
11
12
)
12
13
13
14
type ExitError struct {
You can’t perform that action at this time.
0 commit comments