TeamCity 4.0 Help

TeamCity Addin for NUnit

TeamCity Addin for NUnit allows you to enable on-the-fly tests reporting from NUnit tests runner when automatic integration is not available.

TeamCity provides Addin that you can plugin into NUnit and the tests will automatically be reported to TeamCity server.

It is highly recommended to get the Addin as a part of you build. This way you may ensure that the addin version is compatible with the TeamCity agent version.

For every build, a path to TeamCity Addin for NUnit is set to the system property teamcity.dotnet.nunitaddin (for MSBuild it would be teamcity_dotnet_nunitaddin).

You need to add the version of NUnit to the end of that path (using NAnt syntax):

  • For NUnit 2.4.X use ${teamcity.dotnet.nunitaddin}-2.4.X.dll (for MSBuild: $(teamcity_dotnet_nunitaddin)-2.4.X.dll) Example for NUnit 2.4.7: NAnt: ${teamcity.dotnet.nunitaddin}-2.4.7.dll, MSBuild: $(teamcity_dotnet_nunitaddin)-2.4.7.dll

  • For NUnit 2.5.0 use ${teamcity.dotnet.nunitaddin}-2.5.0.dll (for MSBuild: $(teamcity_dotnet_nunitaddin)-2.5.0.dll)

    To enable on-the-fly test reporting for NUnit, you need to copy TeamCity Addin for NUnit files to the NUnit addin directory. The following example shows how to use NUnit console runner with TeamCity Addin for NUnit 2.4.7 (on MSBuild): <ItemGroup> <NUnitAddinFiles Include="$(teamcity_dotnet_nunitaddin)-2.4.7.*" /> </ItemGroup> <Target Name="RunTests"> <MakeDir Directories="$(NUnitAddinsDir)/addins" /> <Copy SourceFiles="@(NUnitAddinFiles)" DestinationFolder="$(NUnitAddinsDir)/addins" /> <Exec Command="$(NUnit) $(NUnitFileName)" /> </Target>

Last modified: 20 April 2023