-
Bug
-
Resolution: Fixed
-
Critical
-
Jenkins: 2.164.3
Pipeline: Basic Steps: 2.16
If I have a stage with a step in it:
... catchError(buildResult: hudson.model.Result.SUCCESS, message: 'RPM build failed, but allowing job to continue', stageResult: hudson.model.Result.FAILURE) { sh label: env.STAGE_NAME, script: 'exit 2' }
With a post block for the stage:
post { always { archiveArtifacts artifacts: 'artifacts/**' } success { println "${env.STAGE_NAME}: SUCCESS" } unstable { println "${env.STAGE_NAME}: UNSTABLE" } failure { println "${env.STAGE_NAME}: FAILED" } }
I actually get the:
My Test Stage: SUCCESS
telling me that the stage was a SUCCESS, not a FAILURE like the:
catchError(..., stageResult: hudson.model.Result.FAILURE) is supposed to be making it.
In both the stage view and the Blue Ocean view, it does show as a failed stage. The post processing block just doesn't see it that way.
As an aside, is there a variable set for the stage that I could use in my println above so that I could just do a single println in the always block rather than having to repeat it through the success, unstable and failure blocks?
- relates to
-
JENKINS-45579 Step to set stage or parallel status
-
- Resolved
-
-
JENKINS-68288 Object context in BuildCondition.meetsCondition is sometimes a Stage instance, which is not recognized by BuildCondition.getCombinedResult
-
- Open
-
- links to
[JENKINS-57826] catchError(buildResult: hudson.model.Result.SUCCESS, stageResult: hudson.model.Result.FAILURE) doesn't set stage to FAILURE
Link |
New:
This issue relates to |
Labels | New: pipeline |
Component/s | New: pipeline-model-definition-plugin [ 21706 ] | |
Component/s | Original: pipeline [ 21692 ] |
Assignee | New: Andrew Bayer [ abayer ] |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Status | Original: In Progress [ 3 ] | New: In Review [ 10005 ] |
Remote Link | New: This issue links to "PR #330 (Web Link)" [ 23053 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Review [ 10005 ] | New: Resolved [ 5 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Link | New: This issue relates to JENKINS-68288 [ JENKINS-68288 ] |