Hi all,
I eventually had the time to look closer into what is happening under the hood for JENKINS-39203. I found a solution that does not require a code change [1]. For people that maintain a pipeline lib, it is easy to introduce it (if you write this directly in the Jenkinsfile it gets a bit clunky).
I would like to comment this directly in JENKINS-39203, but for some reason it looks like my account is not allowed to comment or create tickets anymore (that's why I'm writing here). Could I get access with my user ghenzler so I can comment this to the ticket? (I think the 132 people that voted for it might not all read this message)
Thanks & Best Regards
Georg
[1]
Pipeline:
stage('Build') { }
for(int i=1; i<=7; i++) {
try{
stage('Test Suite '+i) {
if(Math.floor(Math.random() * 3) % 3 == 0) {
throw new RuntimeException("tests failed, you would use a custom exception type here")
} else {
}
}
} catch(err) { currentBuild.result = 'UNSTABLE' }
}
Result:
(note that all boxes show up as UNSTABLE because the build is unstable, but the stages that have actually failed are marked as failed)
