如何让 TeamCity 获取从 Rake 运行的 NUnit 测试?
当我运行此命令时:
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 没有获取结果 :(
我首先尝试运行我的 NUnit 通过 Gallio 进行测试,但它没有检测任何测试 :(
使用 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 测试,或者如何让 TeamCity 拾取 nunit-console。
When I run this:
sh "#{MBUNIT_PATH}Gallio.Echo.exe /no-echo-results src/#{dll}/bin/Debug/#{dll}.dll"
in my rakefile, Gallio runs my mbunit tests, and TeamCity picks up the results :D
But this:
sh "#{NUNIT_PATH}nunit-console.exe /nologo src/#{dll}/bin/Debug/#{dll}.dll"
does run my tests, but TeamCity doesn't pick up the result :(
I first tried running my NUnit tests through Gallio, but it doesn't detect any tests :(
Using the teamcity NUnit launcher I get:
Failure executing test(s) on assembly nunittests.dll with NUnit 2.5.0.9122. Version 2.0 is not a compatible version.
What would be a solution to this? Either how I can get Gallio to pick up my NUnit tests or how do I get nunit-console to be picked up by TeamCity.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用内置的 NUnit 运行程序。
如果您查看构建代理的目录,只需搜索 *.exe。 应该有一个名为
NUnit-Runner.exe
或类似的东西。 然后您需要使用它。看看这篇文章使用 Rake 和 TeamCity 构建 .NET 解决方案。 大约 3/4 的地方,他展示了我的意思:
为了实现上述目标,我在 Ruby 中做了类似的事情。 我设置了一个 $NUnit 变量,如果属性 ENV['AGENT_WORKING_DIR'] 存在,那么我使用 TeamCity NUnit 运行程序,否则我使用普通的 NUnit(也就是说,开发人员可以运行 Rake 脚本)。
You need to use the inbuilt NUnit runner.
If you look in a build agent's directory, just search for *.exe. There should be one called
NUnit-Runner.exe
or something like that. You then need to use that instead.Have a look at the article Building .NET Solution with Rake and TeamCity. About 3/4 of the way down he shows what I mean:
To achieve the above I did something similar in Ruby. I set up a $NUnit variable, if the property ENV['AGENT_WORKING_DIR'] exists then I use the TeamCity NUnit runner, else I use the normal NUnit (that is, so developers can run the Rake script).