TeamCity Addin for NUnit

Search
Searching TeamCity 4.x Documentation
Table of Contents
NUnit versions support
TeamCity NUnit Test Launcher supports NUnit versions 2.2.10, 2.4.1, 2.4.6, 2.4.7, 2.4.8, and 2.5.0 alpha 4.
TeamCity Addin for NUnit supports only 2.4.6, 2.4.7, 2.4.8, and 2.5.0 alpha 4.

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:
    • copy TeamCity addin assembly both to NUnit bin and bin/addins folders
    • patch NUnit-Console.exe.config to include addins to application probe paths. Add the following code into config/runtime element:
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <probing privatePath="addins"/>
      </assemblyBinding>

      See original blog post on this issue http://nunit.com/blogs/?p=56

    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>

Labels

 
(None)