4
votes

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?

3

3 Answers

4
votes

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.

2
votes

To run it from commandline use below command

D:\AGT10\plugins\dotnetPlugin\bin>JetBrains.BuildServer.NUnitLauncher.exe v4.0 x86 NUnit-2.6.3 D:\AGT10\work\7c6f18d4f70b315c\tests\Tests.AAT.xxx.dll

0
votes

You can use:

%system.teamcity.dotnet.nunitlauncher% /options your.dll

from a command line step