Skip to content

Commit

Permalink
[junit] only include stdout in report for failures
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Mar 18, 2020
1 parent 965679a commit 753824a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/kbn-test/src/mocha/junit_report_generation.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,15 @@ export function setupJUnitReportGeneration(runner, options = {}) {

[...results, ...skippedResults].forEach(result => {
const el = addTestcaseEl(result.node);
el.ele('system-out').dat(escapeCdata(getSnapshotOfRunnableLogs(result.node) || ''));

if (result.failed) {
el.ele('system-out').dat(escapeCdata(getSnapshotOfRunnableLogs(result.node) || ''));
el.ele('failure').dat(escapeCdata(inspect(result.error)));
return;
}

el.ele('system-out').dat('-- logs are only reported for failed tests --');

if (result.skipped) {
el.ele('skipped');
}
Expand Down

0 comments on commit 753824a

Please sign in to comment.