Andrew Bayer
added a comment - 2017-11-23 13:51 PR up for junit at https://github.com/jenkinsci/junit-plugin/pull/91 to switch to setting the Run result, getting currentBuild.result and friends back to behaving like expected.

This fixes currentBuild.result to be UNSTABLE after test failures are
encountered. We'll want to revisit this in the future once we have
more granular stage/step status, but going with
getContext().setResult(...) was, in retrospect, premature optimization.

SCM/JIRA link daemon
added a comment - 2017-11-27 17:22 Code changed in jenkins
User: Andrew Bayer
Path:
src/main/java/hudson/tasks/junit/pipeline/JUnitResultsStepExecution.java
src/test/java/hudson/tasks/junit/pipeline/JUnitResultsStepTest.java
http://jenkins-ci.org/commit/junit-plugin/acd8f4843602a4629344f4cb404cec2dfb7a54d2
Log:
[FIXED JENKINS-48178] Set run result rather than context result
This fixes currentBuild.result to be UNSTABLE after test failures are
encountered. We'll want to revisit this in the future once we have
more granular stage/step status, but going with
getContext().setResult(...) was, in retrospect, premature optimization.