Hi everybody,

we are currently working on the pipelines for our build environment. 
In our old job, the job was set to unstable, if the junit report plugin 
find some failing tests in the results and send an email to a specific user 
group. 
Please have a look to the added screenshot for the old configuration.

Now we have the problem, that we do not get an email if the build gets 
unstable in the pipeline.
It seems that the pipeline do not now that the step was failing, because 
the currentBuild.result is still null.
After the build, the build Status in Jenkins is UNSTABLE, but during the 
pipeline it is null.

Here is my pipeline code:
...
        stage("Junit Report Step") {
       steps {
                junit healthScaleFactor: 1.0, testResults: 
'junit/TEST-*.xml'
            }
            post {
                always {
                echo "Result: ${currentBuild.result}" // result = null
                }
            }
        }

        post {    
           always {
           echo "Result: ${currentBuild.result}" // result = null

            // no mail will be send
             step([$class: 'Mailer',
             notifyEveryUnstableBuild: true,
             recipients: "xxx",
             sendToIndividuals: true])
          }
       }

Is there a way to read the state after the junit plugin has set the status 
to unstable? Is there any way to send a mail notification, if the junit 
task set the build to unstable?

Thanks,
ka51m1r 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8655a24a-901c-4d1e-a764-94793f8ff7a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to