Skip to content

Commit

Permalink
fix(worker): warn for invalid junit file (#6011)
Browse files Browse the repository at this point in the history
Signed-off-by: francois  samin <[email protected]>
  • Loading branch information
fsamin authored Nov 15, 2021
1 parent 06307e1 commit 20cd0e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions engine/worker/internal/action/builtin_junit.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,21 @@ func RunParseJunitTestResultAction(ctx context.Context, wk workerruntime.Runtime
ftests.TestSuites = append(ftests.TestSuites, s)
}
tests.TestSuites = append(tests.TestSuites, ftests.TestSuites...)
if len(ftests.TestSuites) == 0 {
log.Error(ctx, "unable to find testsuites in %q", f)
wk.SendLog(ctx, workerruntime.LevelInfo, fmt.Sprintf("WARNING: unable to parse %q as valid xUnit report file", filepath.Base(f)))
continue
}
log.Info(ctx, "found %d testsuites in %q", len(ftests.TestSuites), f)
} else {
tests.TestSuites = append(tests.TestSuites, vf.TestSuites...)

if len(ftests.TestSuites) == 0 {
log.Error(ctx, "unable to find testsuites in %q", f)
wk.SendLog(ctx, workerruntime.LevelInfo, fmt.Sprintf("WARNING: unable to parse %q as valid xUnit report file", filepath.Base(f)))
continue
}
log.Info(ctx, "found %d testsuites in %q", len(vf.TestSuites), f)
}
}

Expand Down

0 comments on commit 20cd0e1

Please sign in to comment.