Lasse V. Karlsen
Lasse V. Karlsen

Reputation: 391336

TeamCity, invoking the TeamCity NUnit launcher from the command line

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?

Upvotes: 4

Views: 3426

Answers (3)

Ram Maram
Ram Maram

Reputation: 21

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

Upvotes: 2

Grzenio
Grzenio

Reputation: 36649

You can use:

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

from a command line step

Upvotes: 0

CrazyCoder
CrazyCoder

Reputation: 401975

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.

Upvotes: 4

Related Questions