Bug 5833 - Ant build does not properly set exit code on failure
Ant build does not properly set exit code on failure
Product: jbatch
Classification: Unclassified
Component: TCK
: P5 major
: ---
Assigned To: ScottKurz
Depends on:
  Show dependency treegraph
Reported: 2014-02-27 18:50 UTC by chrisschaefer
Modified: 2015-09-03 14:14 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description chrisschaefer 2014-02-27 18:50:08 UTC
When running "ant" in the TCK home directory, if a TCK tests fails or some other test configuration error occurs (say a missing jar from classpath), the ant build will indicate from testng that there was some sort of failure but ant will exit in BUILD SUCCESS. The process will also report an exit code of 0.

If a failure of some sort occurs, it should be reported as so and a non 0 exit code should be returned.

A simple fix to build.xml that I have found is adding the following after </testng> and before </target>:

<fail if="tests.failed" message="JSR-352 TCK TESTS FAILED"/>

This should be fixed so running the TCK can be integrated into other build tools and accurately determine if the test suite was successful.
Comment 1 ScottKurz 2015-09-03 14:14:24 UTC
This has been added to the master branch using:

 <testng ... haltonfailure="true"