There are some "options", I don't know what you might like or find acceptable. If a stage is skipped; it also skips all of its internals.
1: It's not exactly what you want but you can manipulate/mark a stage differently than other stages and continue the execution using something like the skipStagesAfterUnstable option or catchError. For more info see this post. But it may also be to heavy-handed and forcing you into a limited set of results or lead to unwanted execution.
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE')
2: You can move the stage to a separate pipeline/job, and trigger it via or after the run of this pipeline
3: Another option might be something like the following pseudo-code, but this feels more like a hack and adding ('global') 'state flags' adds clutter:
failedOne = false
failedTwo = false
pipeline {
agent any
stages {
stage('Test One') {
steps {...}
post {
failure {
failedOne=true
postFailureOne()
}
}
}
stage('Test Two') {
steps {...}
post {
failure {
failedTwo=true
postFailureTwo()
}
}
}
}
post {
success { .... }
failure {
if (!failedTwo) postFailureTwo()
}
}
}
void postFailureOne() { echo 'Oeps 1' }
void postFailureTwo() { echo 'Oeps 2' }