1

当我运行这个:

sh "#{MBUNIT_PATH}Gallio.Echo.exe /no-echo-results src/#{dll}/bin/Debug/#{dll}.dll"

在我的 rakefile 中,Gallio 运行我的 mbunit 测试,然后TeamCity获取结果:D

但是这个:

sh "#{NUNIT_PATH}nunit-console.exe /nologo src/#{dll}/bin/Debug/#{dll}.dll"

确实运行了我的测试,但 TeamCity 没有得到结果:(

我首先尝试通过Gallio运行我的NUnit测试,但它没有检测到任何测试:(

使用 teamcity NUnit 启动器,我得到:

Failure executing test(s) on assembly nunittests.dll with NUnit 2.5.0.9122. Version 2.0 is not a compatible version.

对此有什么解决方案?如何让 Gallio 接受我的 NUnit 测试,或者如何让 nunit-console 被 TeamCity 接受。

4

1 回答 1

3

您需要使用内置的 NUnit 运行器。

如果您查看构建代理的目录,只需搜索 *.exe。应该有一个叫NUnit-Runner.exe或类似的东西。然后,您需要改用它。

查看文章使用 Rake 和 TeamCity 构建 .NET 解决方案。大约 3/4 的时候,他表达了我的意思:

为了实现上述目标,我在 Ruby 中做了类似的事情。我设置了一个 $NUnit 变量,如果属性 ENV['AGENT_WORKING_DIR'] 存在,那么我使用 TeamCity NUnit 运行器,否则我使用普通的 NUnit(也就是说,开发人员可以运行 Rake 脚本)。

于 2009-09-25T07:31:40.800 回答