Skip to content

Commit

Permalink
JENKINS-54559 set the result on the build on not on the context`
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrille Le Clerc committed Nov 11, 2018
1 parent 5644473 commit c355a75
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,12 @@ private void executeReporter(StepContext context, TaskListener listener, List<El
listener.getLogger().println("[withMaven] junitPublisher - unit tests are all successful");
}
} else {
// TODO: Once JENKINS-43995 lands, update this to set the step status instead of the entire build.
if (LOGGER.isLoggable(Level.FINE)) {
listener.getLogger().println("[withMaven] junitPublisher - " + testResultAction.getResult().getFailCount() + " unit test failure(s) found, mark job as unstable");
}
context.setResult(Result.UNSTABLE);
// TODO: Once JENKINS-43995 lands, update this to set the step status instead of the entire build.
// context.setResult(Result.UNSTABLE);
run.setResult(Result.UNSTABLE);
}
} catch (Exception e) {
listener.error("[withMaven] junitPublisher - Silently ignore exception archiving JUnit results for Maven artifact " + mavenArtifact.toString() + " generated by " + pluginInvocation + ": " + e);
Expand Down

0 comments on commit c355a75

Please sign in to comment.