| Running following code:
pipeline {
agent label: ''
stages {
stage ('Build') {
steps{
sh 'echo1 "Building"'
}
}
stage ('Test') {
steps{
sh 'echo "Test"'
}
}
stage ('Deploy') {
steps{
sh 'echo "Building"'
}
}
}
}
Only step in Build stage fails, declarative plugin adds extra print step to print there was failure however this step is not marked as error resulting in failure to mark the stage as error using StatusAndTiming.computeChunkStatus() api, which reports status of stage based on last step. That is if last sep was success, that means all is well. Sam Van Oort, this also shows up 'Build' stage as success in stage view plugin. Intent of declarative plugin is to report error that running that stage failed, this extra step it injects should have step.getError() return an error object otherwise it defeats the purpose. |