I been trying to register junit tests even when a script fails within a worspace of specific node in multi-stage parallel build.
With the following structure and by adding the post action within the stage scope, but outside the node scope when the sh script fails it also fails to run the post action and register the generated tests.
I would appreciate any suggestions on this.
stage('Unit Test') {
parallel 'tests': {
node('A') {
ws() {
sh ...
}
}
post {
always {
junit "build/pytest-results/*.xml"
}
}
},
'python3: more tests ': {
node('B') {
ws() {
sh ...
}
}
post {
always {
junit "build/pytest-results/*.xml"
}
}
},
'more tests': {
node('C') {
ws() {
sh ...
}
}
post {
always {
junit "build/pytest-results/*.xml"
}
}
},