CruiseControl.net 1.5.7256.1: my build fails but the dashboard shows success
We are experiencing issues with CruiseControl.Net 1.5.7256.1. Our builds are showing success when they actually fail. We force the build, it runs unit tests, some units tests fail and it shows success. We are using an exec task to execute an ant script. Here's the target that executes the tests:
<target name="test" depends="build" description="unit test" >
<copy file="configuration_notag.txt" tofile="${build.dir}\configuration.txt"/>
<junit errorProperty="test.failed" failureProperty="test.failed">
<formatter type="brief" usefile="false" />
<formatter type="开发者_StackOverflow社区xml" />
<classpath refid="classpath" />
<test name="${test1.class}" />
<test name="${test2.class}" />
</junit>
<fail message="Tests failed: check test reports." if="test.failed" />
</target>
Here is the output in the build file:
Errors: (4) [junit] Test TestNoTag FAILED BUILD FAILED C:\sandbox\idblue\idblue\trunk\Unit_Test\IDBlueJavaWindowsUnitTest\build_notag.xml:43: Tests failed: check test reports. Total time: 2 minutes 37 seconds
Since ant is failing, returning a failure error code, why isn't cruisecontrol picking up on it? There's nothing to note in our ccnet.config file, it just calls ant with the proper build file. We did not have this problem with CruiseControl.Net 1.4.2. Has anyone else ran into this issue? Googled the problem but found nothing.
I figured out what the problem was after, I needed to add this to the last line of ant.bat:
exit %ERRORLEVEL%
This persisted the exit code back to CruiseControl and the build finally started failing properly.
精彩评论