TeamCity Cloud 2020.2 Help

NUnit Support

There are two most common methods to set up NUnit tests reporting in TeamCity:

Besides that, you can try alternative approaches or run tests in any other runner (like PowerShell or Command Line) with the TeamCity VSTest Adapter.

Framework Compatibility

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+

NUnit runner

  • nunit-console.exe
  • nunit3-console.exe

check.png

check.png

error.png

.NET CLI runner

  • dotnest test
  • dotnet msbuild /t:VSTest
  • dotnet vstest

error.png

check.png

check.png

VSTest adapter in other runners

error.png

check.png

check.png

Alternative Approaches

If using NUnit build runner is inapplicable, TeamCity provides the following ways to configure NUnit tests reporting in TeamCity:

Feature Comparison for Alternative Approaches

Approach

Real-time Reporting

Execution in CLI-based runners

Tests Reordering

Implicit TeamCity .NET Coverage

<nunit2> NAnt task

check.png

check.png/ error.png*

check.png

check.png

<NUnit> MSBuild task

check.png

check.png/ error.png*

check.png

check.png

<NUnitTeamCity> MSBuild task

check.png

check.png/ error.png*

check.png

check.png

TeamCity Addin for NUnit

check.png

error.png

error.png

error.png

TeamCity NUnit Test Launcher

check.png

error.png

check.png

check.png

XML Reporting Plugin

error.png

check.png

N/A

N/A

* 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.

Last modified: 31 August 2020