Fail Pipeline in Jenkins
I have used Jenkins to create a CI pipeline for my node js application. My pipeline includes jobs such as build,unit test,integration test,code analysis etc. I was wondering if it is possible to fail a build if for example by implementing threshold like z number of tests failed or pass rate < z% ? I know by default a build will fail if even one test case fails.
2 Solutions collect form web for “Fail Pipeline in Jenkins”
Your unit test script will need to handle the math & logic to determine what percent of tests failing is bad enough to fail the whole job. Then your unit test script can return pass (zero) or fail (anything else) and Jenkins will mark the build accordingly.
Try Multijob Plugin
This plugin also helps to run your pipelined jobs