nunit2 Nant任务始终返回退出代码0(TeamCity 5.0)

nunit2 Nant任务始终返回退出代码0(TeamCity 5.0),nunit,nant,teamcity,Nunit,Nant,Teamcity,我就是不能让我的nant构建文件在测试失败时终止并返回,从而阻止打包和工件步骤运行 这是nant文件的单元部分: <target name="unittest" depends="build"> <nunit2 verbose="true" haltonfailure="false" failonerror="true" failonfailureatend="tr

我就是不能让我的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>
请帮忙,因为我不想在单元测试失败的地方发布二进制文件

TeamCity 5.0构建10669

AppMonapItems.dll引用

nunit.framework.dll v2.5.3.9345

生成服务器或GAC上未安装单元

使用Nant-0.85和NANTB-0.85

谢谢,
Jonathan

这是我使用的目标,如果任何测试失败,它将终止:

<target name="test" depends="compile_tests,copy_dependencies">
    <mkdir dir="${testlogdir}"/>

    <echo message="Please make sure that nunit-console is in your path."/>
    <echo message="This file can be found in the NUnit bin directory."/>

    <nunit2 verbose="true">
        <formatter type="Xml" usefile="true" outputdir="${testlogdir}" extension=".xml"/>
        <formatter type="Plain" usefile="true" outputdir="${testlogdir}" extension=".txt"/>
        <test assemblyname="${build_classdir}\${namespace_file}.Test.dll"/>
    </nunit2>

</target>

看起来这些不应该引起问题,但是试着让一些基本的东西工作,然后你可以开始添加属性,看看是什么使它停止工作。

您好,删除这些属性没有什么区别。请记住,我没有使用nunit控制台,但我依靠TeamCity将nunit2任务替换为自定义任务。我没有使用任何nunit TeamCity插件或运行程序,因此到底是什么在运行测试是一个谜。。。。doco在整个地区都有点差劲,令人沮丧
<target name="test" depends="compile_tests,copy_dependencies">
    <mkdir dir="${testlogdir}"/>

    <echo message="Please make sure that nunit-console is in your path."/>
    <echo message="This file can be found in the NUnit bin directory."/>

    <nunit2 verbose="true">
        <formatter type="Xml" usefile="true" outputdir="${testlogdir}" extension=".xml"/>
        <formatter type="Plain" usefile="true" outputdir="${testlogdir}" extension=".txt"/>
        <test assemblyname="${build_classdir}\${namespace_file}.Test.dll"/>
    </nunit2>

</target>
haltonfailure="false" failonerror="true" failonfailureatend="true"