Running below code on test results
[$class: 'SkippedThreshold', failureThreshold: '0'],
[$class: 'FailedThreshold', failureThreshold: '0']],
tools: [[$class: 'XUnitDotNetTestType', pattern: "xunit_result.xml"]]
produces this output:
INFO: Starting to record.
INFO: Processing xUnit.Net-v2 (default)
INFO: [xUnit.Net-v2 (default)] - 1 test report file(s) were found with the pattern 'xunit_result.xml' relative to 'C:\Jenkins\Workspace\EDM Platform\druid\feature\publishToSandT\2' for the testing framework 'xUnit.Net-v2 (default)'.
INFO: Check 'Skipped Tests' threshold.
INFO: Check 'Failed Tests' threshold.
INFO: The total number of tests for this category exceeds the specified "failure" threshold value.
INFO: Setting the build status to FAILURE
INFO: Stopping recording.
but it does not fail the build in the spot. Because of this all stages afterwards are done as normal, just after the whole process build is marked as failed:
Post Action: Add badges
[Pipeline] End of Pipeline
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 59s
[Bitbucket] Notifying commit build result
[Bitbucket] Build result notified
[Office365connector] No webhooks to notify
so everything else (even other plugins, not just my code) assume success.
I can workaround it checking the build status after processing results, but I don't think it is intended behaviour.