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

Unstable build from junit not picked up in currentBuild.result

XMLWordPrintable

    • 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.

       

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

              Created:
              Updated: