Tutorial :How do I get TeamCity to pick up my NUnit tests run from Rake?



Question:

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.


Solution:1

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).


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »