Configuring Test Reports and Code Coverage
This section contains articles concerning support of test reports, code inspections, and code coverage in TeamCity.
Test Reports in TeamCity
TeamCity provides out-of-the-box support for a number of testing frameworks. To reduce the feedback time on test failures, it reports detailed test results on the fly whenever possible. These results are displayed in the build overview. See the list of currently supported testing frameworks.
Many build runners produce test reports automatically, depending on the settings you configure: Gradle, Maven, IntelliJ IDEA Project, Python, Node.js, NUnit and others.
Code Inspection in TeamCity
TeamCity comes with code analysis tools capable of inspecting your source code on the fly, finding and reporting common problems and anti-patterns.
The following inspections tools are bundled with TeamCity:
Inspections (IntelliJ IDEA): runs code analysis based on IntelliJ IDEA inspections. More than 600 Java, HTML, CSS, JavaScript inspections are performed by this runner.
Inspections (ReSharper): gathers results of JetBrains ReSharper Code Analysis in your C#, VB.NET, XAML, XML, ASP.NET, JavaScript, CSS, and HTML code.
Inspection results are reported in the Code Inspection tab of the Build Results page.
TeamCity can also be integrated with external reporting tools.
Code Coverage in TeamCity
Code coverage is a number of metrics that measure how your code is covered by unit tests. TeamCity supports the following coverage engines out of the box:
Java, see Configuring Java Code Coverage
IntelliJ IDEA coverage (bundled)
EMMA open-source toolkit (bundled)
JaCoCo open-source (bundled)
.NET: see Configuring .NET Code Coverage
JetBrains dotCover (bundled)
See how to import reports or coverage results from other tools.
To get the code coverage information displayed in TeamCity for the supported tools, you need to configure it in the dedicated section of a build runner's settings page. The following build runners include code coverage support:
Note that currently the Maven2 runner supports only IntelliJ IDEA and JaCoCo coverage engines.
The code coverage results can be viewed on the Overview tab of Build Results. A detailed report is displayed on the dedicated Code Coverage tab.
The chart for code coverage is also available on the Statistic Charts tab of a build configuration.
For the details on configuring code coverage, refer to the dedicated pages: Configuring Java Code Coverage, Configuring .NET Code Coverage.