function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JasonRogersJasonRogers 

new Ant tool doesn't run all tests when runAllTests='true'

I just upgraded to the new Ant integration library from the Salesforce tools section.  Calling Ant on the following target does not run the tests, or at least the build doesn't report a failure when the tests fail.  How do I know this?  I added a failing test and expected to get a failed build.  No such luck.  Build was reported as successful.  However, if I list out the tests to run with child 'runTest' tags, the build does fail.

Here's the target with 'runAllTests' set (bulid reported as successful even though it should be a failure):
Code:
<target name="deployCode" depends='use_test_environment,use_prod_environment'>
  <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" runAllTests="true" deployroot="retrieveUnpackaged" singlePackage="true" />
</target>

 
Here's the target with test classes specified (one test fails and the build is reported as a failure):
Code:
<target name="deployCode" depends='use_test_environment,use_prod_environment'>
  <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployroot="retrieveUnpackaged" singlePackage="true">
    <runTest>CronUtil</runTest>
    <runTest>EmailToRSSHandler</runTest>
    <runTest>FeedIdRetriever</runTest>
    <runTest>FinanceEmailer</runTest>
    <runTest>InvoiceUtil</runTest>
    <runTest>OpportunityProductUtil</runTest>
    <runTest>OpportunityUtil</runTest>
    <runTest>RSSFeedItem</runTest>
    <runTest>TestUtil</runTest>
    <runTest>Util</runTest>
  </sf:deploy>
</target>