Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
Jenkins 2.19
junit 1.18
Description
I'm using JUnitResultsArchive to record test results, and I'm seeing a weird bug where there are failures reported but the build is not marked unstable.
This is via Jenkins pipeline, and immediately after the step, I'm echoing the build result:
step([$class: 'JUnitResultArchiver', testResults: 'build/xunit.xml']) echo ">>> BUILD RESULT ${currentBuild.result}"
I can confirm that a test failed in that step, and the result printed is ">>> BUILD RESULT null"
This doesn't always happen - in some other runs, the result is UNSTABLE as expected.
Attachments
Issue Links
- links to
Code changed in jenkins
User: Andrew Bayer
Path:
pipeline-model-definition/pom.xml
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/conditions/Aborted.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/conditions/Changed.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/conditions/Failure.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/conditions/NotBuilt.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/conditions/Success.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/conditions/Unstable.groovy
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BuildConditionResponderTest.java
pipeline-model-definition/src/test/resources/contextResultOverridesRunResult.groovy
pipeline-model-definition/src/test/resources/junitResult.xml
pipeline-model-extensions/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/model/BuildCondition.java
pom.xml
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/d533dd551dadca3d278f3c877aead9016d514b8c
Log:
[FIXED JENKINS-37663] Check execution result in post as well
The new junit step doesn't set the Run to UNSTABLE directly, it sets
the context (and therefore the execution) result to UNSTABLE. We
should be checking the execution result as well as the Run result.