Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48178

Unstable build from junit not picked up in currentBuild.result

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • junit-plugin
    • None

      Some time back, declarative pipelines were marking a stage as unstable, and I was able to have something like:

      pipeline {
        stage {
          steps {
            sh 'runuittests'
          }
          post {
            always {
              junit 'junit.xml'
            }
          }
        }
        stage {
          when {
            expression {
              currentBuild.resultIsBetterOrEqualTo('SUCCESS')
            }
          }
          steps {
            // Only runs when tests are stable
          }
        }
      }

      However, this stopped working at some point in the recent past.  

       

      currentBuild.result does not seem to be populated when junit marks the build unstable.

       

          [JENKINS-48178] Unstable build from junit not picked up in currentBuild.result

          Will Freeman created issue -
          Andrew Bayer made changes -
          Assignee New: Andrew Bayer [ abayer ]
          Andrew Bayer made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Andrew Bayer made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Andrew Bayer made changes -
          Remote Link New: This issue links to "junit PR #91 (Web Link)" [ 18137 ]
          Andrew Bayer made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]
          Andrew Bayer made changes -
          Component/s New: junit-plugin [ 15499 ]
          Component/s Original: workflow-cps-plugin [ 21713 ]
          Andrew Bayer made changes -
          Link New: This issue is duplicated by JENKINS-48267 [ JENKINS-48267 ]
          Dan Nussbaumer made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Andrew Bayer made changes -
          Assignee Original: Andrew Bayer [ abayer ]

            Unassigned Unassigned
            therealwaldo Will Freeman
            Votes:
            2 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: