Reputation: 636
Small Jenkins question about Jenkins triggering mechanism.
I want a build that have unit test failure to not be automatically triggered anymore.
The developper that break the test(s) has to fix it and to launch the build manually.
I tried to find a solution, and the 'best' solution I found is to use the Disable Failed Job Plugin. But I'm not satisfied of it because the build is totally disabled.
Is it possible in Jenkins to do it, or does it exists some plugin that can helps me ?
Thank you,
Seb
Upvotes: 0
Views: 1473
Reputation: 8164
There is no simple solution for that. If the job has the SCM polling
build trigger configured, then it will run whenever there's a change.
So, if you want to prevent that without disabling the job, then you must remove the SCM trigger from the Job configuration. It is possible to do that automatically, but you'll end up with an ugly setup, since
I recommend to stick with disabling the job upon failure. Possibly, you can additionally setup a copy of the job that developers can trigger manually.
Upvotes: 1
Reputation: 171
Write Groovy script / Java program,
Read Unit test log from the jenkins console, it will consolidate and give you no of test cases passed/failed. if failed test cases is more than 0, set System.exit(1).
after ur application build step execution, call this script or java program from command line from batch or sh.
Upvotes: 2