2012-06-05 102 views
1

我已经集成了巡航控制的连续构建过程。在EOD中,它会生成构建报告。如果任何NUnit测试用例失败,则构建失败。我们写了一个特定的测试用例,并将其添加到单独的dll中。如果该程序集中的任何测试用例失败,我们不希望我们的构建失败。我们使用MSBuild目标,.proj文件和巡航控制,ccnet配置文件。即使一个特定的NUnit测试失败,MSBuild也不会失败

回答

1

我会两次调用NUnit:一次为了测试你想失败的构建如果没有通过,那么第二次运行测试的结果你不想影响构建,例如,

<!-- Any failing tests in Assembly1.dll will cause the build to fail. --> 
<Exec Command="nunit.exe Assembly1.dll" /> 

<!-- Any failing tests in Assembly2.dll won't fail the build because the ContinueOnError attribute is set to True. --> 
<Exec Command="nunit.exe Assembly2.dll" ContinueOnError="True" /> 
+1

如果有任何测试失败,则将ContinueOnError设置为true将执行该程序集中剩余的测试。但是Build仍然失败,因为我的测试失败了。所以ContinueInError = true不起作用 – user660232

相关问题