tags:

views:

483

answers:

1

I'm trying to split up some rather lengthy unit test executions across multiple build agents with TeamCity, so I removed the unit test part of the build step (using Visual Studio 2008, sln2008 build runner) in TeamCity and trying to set up separate build steps.

However, I'm unable to invoke the built-in NUnit launcher that comes with TeamCity.

From the System Properties page of the agents, I have this:

teamcity.dotnet.nunitlauncher
C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe

I've verified the file is actually there.

The question is, how do I specify to use this system property when defining the build step? I've set up a new build step, with the appropriate dependencies on the step that produces the binaries, and I've verified that this works by using the normal NUnit console, but this doesn't report to TeamCity properly how many tests that were executed, so I thought I'd replace it with the built-in NUnit launcher.

I've tried to set up a command line step with the following command executable variations, none work and they all give me an error which basically states that the file is not found:

${teamcity.dotnet.nunitlauncher}
$(teamcity.dotnet.nunitlauncher)
%sys.teamcity.dotnet.nunitlauncher%
%env.teamcity.dotnet.nunitlauncher%
%env.teamcity_dotnet_nunitlauncher%

Any ideas what I'm doing wrong?

+2  A: 

Refer to the article describing similar configuration. $(teamcity_dotnet_nunitlauncher) should work.

If you want it to work with the command line build, you should define a custom environment variable in the build configuration, like teamcity.dotnet.nunitlauncher with a value %system.teamcity.dotnet.nunitlauncher%. From the batch file this variable can be referenced as %teamcity.dotnet.nunitlauncher%. Refer to the related forum post for details.

CrazyCoder
This only works inside a Visual Studio msbuild step. I still need to find a working configuration for the command line runner setup of TeamCity itself.
Lasse V. Karlsen
I've updated my reply with the details for the command line build.
CrazyCoder