Skip to content

Commit

Permalink
fix: Make sure job errors are always printed (#985)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhan83 authored Nov 28, 2024
1 parent 832439e commit 7f0aae3
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions internal/saucecloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,25 +788,30 @@ func (r *CloudRunner) isFileStored(filename string) (storageID string, err error

// logSuite display the result of a suite
func (r *CloudRunner) logSuite(res result) {
// Job isn't done, hence nothing more to log about it.
if !job.Done(res.job.Status) || r.Async {
return
}

logger := log.With().
Str("suite", res.name).
Bool("passed", res.job.Passed).
Str("url", res.job.URL).
Logger()

if res.skipped {
logger.Error().Err(res.err).Msg("Suite skipped.")
if res.err != nil {
if res.skipped {
logger.Error().Err(res.err).Msg("Suite skipped.")
return
}
if res.job.ID == "" {
logger.Error().Err(res.err).Msg("Suite failed to start.")
return
}
logger.Error().Err(res.err).Msg("Suite failed unexpectedly.")
return
}
if res.job.ID == "" {
logger.Error().Err(res.err).Msg("Suite failed to start.")

// Job isn't done, hence nothing more to log about it.
if !job.Done(res.job.Status) || r.Async {
return
}

if res.job.TimedOut {
logger.Error().Msg("Suite timed out.")
return
Expand Down

0 comments on commit 7f0aae3

Please sign in to comment.