jenkinsjenkins-pipelinejobsstage

Continue Jenkins job after failed stage while marking stage as failed


I currently have separate perf tests running as 4 jenkins stages. Currently if a perf test fails the entire pipeline fails. I can mitigate this by wrapping in a try catch which will let me continue, but will mark the stage as a success when it has actually failed. I'd like to get a red failure box for the stage that has failed, and allow the other stages to run. I'm not worried if Jenkins marks the entire job as a failure, so long as the stage that failed is highlighted and doesn't prevent other stages from running.


Solution

  • Have a look here Show a Jenkins pipeline stage as failed without failing the whole job

    Note that you have a choice whether to mark the whole job as failed or not, but most importantly all stages are done regardless while marking those that failed.

    I think this is a duplicate question, but I can't link the questions.