TeamCity Addin for NUnit allows you to enable on-the-fly tests reporting from NUnit tests runner.
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) and to the environment variable 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 alpha 4 use ${teamcity.dotnet.nunitaddin}-2.5.0.dll (for MSBuild: $(teamcity_dotnet_nunitaddin)-2.5.0.dll)
 | It is strongly recommended to copy .dll and .pdb TeamCity Addin for NUnit files every time you run the particular build, because these files could be updated by TeamCity. |
 | NUnit 2.4.8 has the following known issue: NUnit 2.4.8 runner tries to load assembly according to created AssemblyName object, however, 'addins' folder of NUnit 2.4.8 is not included in application probe paths. Thus NUnit 2.4.8 fails to load any addin in console mode.
To solve the problem we suggest you to use any of the following workarounds:
|
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">
<Copy SourceFiles="@(NUnitAddinFiles)" DestinationFolder="$(NUnitAddinsDir)" />
<Exec Command="$(NUnit) $(NUnitFileName)" />
</Target>