NUnit Support
TeamCity provides a variety of ways to set up NUnit tests reporting. It is able of running NUnit tests by means of TeamCity NUnit Test Launcher, as well as it can pick up the tests results from another runner.
Basically, NUnit support in TeamCity includes the following:
TeamCity support standard NUnit for MSBuild.
TeamCity provides NUnit for MSBuild and supports NUnit for MSBuild from the MSBuild Community tasks.
TeamCity provides its own NUnit Test Launcher, that can be configured Configuring TeamCity NUnit Launcher via Web UI, or NUnit for MSBuild, or launched from TeamCity NUnit Test Launcher.
TeamCity Addin for NUnit is available to turn on reporting on NUnit level without build procedure modifications.
The bundled XML Test Reporting allows to import any xml report to TeamCity. In this case it is not always possible to track results on the fly.
TeamCity allows to configure tests reporting manually via Build Script Interaction with TeamCity.
Comparison matrix:
Approach | Real-Time Reporting | Execution without TeamCity | Tests Reordering | NUnit Addins Support | Implicit TeamCity .NET Coverage |
|---|---|---|---|---|---|
| / if custom syntax | ||||
| / if custom syntax | ||||
| / if custom syntax | ||||
TeamCity addin for NUnit | |||||
TeamCity NUnit Test Launcher | |||||
XML Reporting Plugin | only xml | N/A | N/A | N/A |
Supported NUnit versions:
TeamCity NUnit Test Launcher (this also relates to
<nunit2>or<NUnit>task usage) supports versions 2.2.10, 2.4.1, 2.4.6, 2.4.7, 2.4.8, 2.5.0, 2.5.2, 2.5.3, 2.5.4, and 2.5.5.TeamCity Addin for NUnit supports versions 2.4.6, 2.4.7, 2.4.8, 2.5.0, 2.5.2, 2.5.3, 2.5.4, and 2.5.5.
XML Reporting plugin supports any versions
In addition to the common test reporting features, TeamCity relieves a headache of running your NUnit tests under x86 process on the x64 machine by introducing an explicit specification of the platform and run-time environment versions. You can define whether to use .NET Framework 1.1, 2.0 or 4.0 started under MSIL, x64 or x86 platform.
old page content
There are multiple ways to run tests with NUnit to support TeamCity's test reporting ability:
for NAnt build: use standard
<nunit2>task in NAnt build (it is NUnit for NAnt build runner with TeamCity-capable task);for MSBuild build: use standard
<NUnit>task from the MSBuild Community tasks (it is NUnit for MSBuild with TeamCity-capable task);use TeamCity-provided TeamCity NUnit Test Launcher
use TeamCity addin for NUnit to turn on reporting on NUnit level without build procedure modifications;
for unsupported frameworks: manually report test results via Build Script Interaction with TeamCity.
For all supported NUnit versions TeamCity tracks the tests and reports all the information on-the-fly (both in the web UI and your IDE). In real-time mode TeamCity Tests Tab on every test run within a build: its status, name, package, duration, and statistics.
TeamCity informs user about tests failure immediately and provides details on occurred errors on the Overview tab of Build Results Home Page. For each failed or ignored test TeamCity web UI provides a direct link to open it in your IDE.
Besides, TeamCity relieves a headache of running your tests under x86 process on the x64 machine by introducing an explicit specification of the platform and run-time environment versions. You can define whether you use .NET 1.1 and MSIL, x64 or x86 platform to use for .NET 2.0 version in TeamCity NUnit Test Launcher, NUnit for NAnt Build Runner, NUnit for MSBuild, sln2003, sln2005, sln2008.