There are two most common methods to set up NUnit tests reporting in TeamCity:
The NUnit build runner supports only .NET Framework. To run tests for .NET Core projects (and .NET Framework projects version 4.0 or later), use the .NET CLI (dotnet) build runner with the
test command instead.
The following table represents the compatibility of TeamCity runners with the .NET implementations:
.NET Framework 1, 1.1, 2, 3.5
.NET Framework 4+
.NET Core 1+
.NET CLI runner
VSTest adapter in other runners
If using NUnit build runner is inapplicable, TeamCity provides the following ways to configure NUnit tests reporting in TeamCity:
TeamCity supports the standard NUnit for NAnt Build Runner.
TeamCity Addin for NUnit is available to turn on reporting on the NUnit level without build procedure modifications.
The bundled XML Test Reporting plugin allows importing any XML report to TeamCity. In this case it is not always possible to track results on the fly.
You can add the XML Report Processing build feature to your build configuration, or use the following service message:
##teamcity[importData type='sometype' path='<path to the xml file>']. Learn more: XML Report Processing, Build Script Interaction with TeamCity.
TeamCity allows configuring tests reporting manually via service messages.
Feature Comparison for Alternative Approaches
Execution in CLI-based runners
Implicit TeamCity .NET Coverage
<nunit2> NAnt task
<NUnit> MSBuild task
<NUnitTeamCity> MSBuild task
TeamCity Addin for NUnit
TeamCity NUnit Test Launcher
XML Reporting Plugin
* TeamCity-provided tasks may have different syntax/behavior. Some workarounds may be required to run the script without TeamCity.
In addition to the common test reporting features, TeamCity allows running NUnit tests under the x86 process on the x64 machine by introducing an explicit specification of the platform and runtime environment versions. You can define whether to use .NET Framework 1.1, 2.0 or 4.0 started under an MSIL, x64 or x86 platform.