nunit2 Nant task always returns exit code 0 (TeamCity 5.0)

Posted by Jonathan on Stack Overflow See other posts from Stack Overflow or by Jonathan
Published on 2009-12-24T11:43:30Z Indexed on 2010/03/29 7:03 UTC
Read the original article Hit count: 415

Filed under:
|
|
|

Hello,

I just cannot for the life of me get my nant build file to terminate upon a test failure and return (thus preventing the packaging and artifact step from running)

This is the unit part of the nant file:

<target name="unittest" depends="build">
  <nunit2 verbose="true" haltonfailure="false" failonerror="true" failonfailureatend="true">
   <formatter type="Xml" />
   <test assemblyname="Code\AppMonApiTests\bin\Release\AppMonApiTests.dll" />
  </nunit2>
</target>

And regardless what combination of true/false i set the haltonfailure, failonerror, failonfailureatend properties to, the result is always this:

[11:15:09]: Some tests has failed in C:\Build\TeamCity\buildAgent\work\ba5b94566a814a34\Code\AppMonApiTests\bin\Release\AppMonApiTests.dll, tests run terminated. 
[11:15:09]: NUnit Launcher exited with code: 1
[11:15:09]: Exit code 0 will be returned.1

Please help as i don't want to be publishing binarys where the unit tests have failed!!!

TeamCity 5.0 build 10669

AppMonApiTests.dll references

nunit.framework.dll v2.5.3.9345

unit isn't installed on the build server or GAC'd

Using Nant-0.85 and Nantcontrib-0.85

Thanks, Jonathan

© Stack Overflow or respective owner

Related posts about teamcity

Related posts about nant