Hi : I hava an ANT build which fails, and halts on failure. I want the build to (rather than halting on failure of a single unit test), finish running ALL unit tests, so that I can know which ones passed/failed.
Then (of course), I want the build to ultimately fail, printing out the number of failed tests.
Oddly, it appears that "haltonfailure", does more then "halt" the build : it actually changes the Success/Failure outcome as interpretted by Jenkins !
I would like to , if possible, use the custom "fail" tag to make this clear in my build script, i.e. something like :
<fail message="Some test(s) failed !">
<condition>
<not>
<testFailures>0</testFailures>
</not>
</condition> </fail>
The failureproperty attribute on the Junit task and a conditional fail works well. I use it for generating the junit html reports even if the tests fail.
<junit failureproperty="junit.failed" haltonfailure="no">
<!--- stuff -->
</junit>
<!-- Generate junit reports, pmd, coverage, etc -->
<fail if="junit.failed" message="Failed tests"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With