CruiseControl.net 1.5.7256.1 : my build fails but the dashboard shows success

标签 cruisecontrol.net

我们在使用 CruiseControl.Net 1.5.7256.1 时遇到问题。当我们的构建实际上失败时,它们却显示出成功。我们强制构建,它运行单元测试,一些单元测试失败,但它显示成功。我们使用 exec 任务来执行 ant 脚本。这是执行测试的目标:

<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="xml" />
<classpath refid="classpath" />
<test name="${test1.class}" />
<test name="${test2.class}" />
</junit>
<fail message="Tests failed: check test reports." if="test.failed" />
</target>

这是构建文件中的输出:

错误:(4) [junit] 测试 TestNoTag 失败 构建失败 C:\sandbox\idblue\idblue\trunk\Unit_Test\IDBlueJavaWindowsUnitTest\build_notag.xml:43:测试失败:检查测试报告。 总时间:2分37秒

既然 ant 失败并返回失败错误代码,为什么 Cruisecontrol 没有发现它?我们的 ccnet.config 文件中没有什么需要注意的,它只是使用正确的构建文件调用 ant。 CruiseControl.Net 1.4.2 没有出现此问题。还有其他人遇到过这个问题吗?谷歌搜索了这个问题,但一无所获。

最佳答案

我弄清楚了问题所在,我需要将其添加到 ant.bat 的最后一行:

退出%ERRORLEVEL%

这将退出代码保留回 CruiseControl,构建最终开始正常失败。

关于CruiseControl.net 1.5.7256.1 : my build fails but the dashboard shows success,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3805986/

相关文章:

cruisecontrol.net - 如何将exec的输出分配给NAnt中的属性

parameters - CruiseControl.Net - ccnet.config 中参数的使用

build-process - 如何使用 CruiseControl.Net 构建忽略可执行文件的输出?

mercurial - 巡航控制和 Mercurial。设置问题

cruisecontrol.net - 如何在 CruiseControl BuildReport 中包含 SpecFlow .html 报告?

c# - 由于缺少依赖项,MSBuild 清理操作失败

svn - 迁移到 Team System 和从 Team System 迁移的工具有多好?

c++ - msbuild C++ : how do I supply desired version info as command line parameter?

CruiseControl.Net NUnit 结果未显示在仪表板中