nunit2 Nant 任务始终返回退出代码 0 (TeamCity 5.0)
我只是无法让我的 nant 构建文件在测试失败时终止并返回(从而阻止打包和工件步骤运行)
这是 nant 文件的单元部分:
<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>
并且无论 true/false 的组合如何我将haltonfailure、failonerror、failonfailureatend属性设置为,结果始终是这样的:
[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
请帮忙,因为我不想发布单元测试失败的二进制文件!
TeamCity 5.0 版本 10669
AppMonApiTests.dll 引用
nunit.framework.dll v2.5.3.9345
单元未安装在构建服务器或 GAC 上
使用 Nant-0.85 和 Nantcontrib-0.85
谢谢, 乔纳森
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我使用的目标,如果任何测试失败,它就会终止:
所以对于初学者,您可以尝试删除:
看起来那些不应该引起问题,但尝试让一些基本的工作正常,然后您可以开始添加属性以查看是什么导致它停止工作。
This is the target I use and it terminates if any tests fail:
So for starters, you could try removing:
It seems like those shouldn't be causing a problem, but try to get something basic working, and then you can start adding in attributes to see what makes it stop working.