TeamCity Cloud 2023.09 Help

IntelliJ IDEA

The IntelliJ IDEA coverage engine in TeamCity is the same engine that is used within IntelliJ IDEA to measure code coverage. This coverage attaches to the JVM as a Java agent and instruments classes on the fly when they are loaded by the JVM. In particular, it means that classes are not changed on the disk and can be safely used for distribution packages.

The IntelliJ IDEA coverage engine currently supports Class, Method, and Line coverage. There is no Branch/Block coverage yet.

To configure code coverage using IntelliJ IDEA engine, follow these steps:

  1. While creating/editing Build Configuration, go to the Build Step page.

  2. Select the Ant, IntelliJ IDEA Project, Gradle or Maven build runner.

  3. In the Code Coverage section, select IntelliJ IDEA as a coverage tool in the Choose coverage runner drop-down menu.

  4. Set up the coverage options - refer to the description of the available options below.

Option

Description

Classes to instrument

Specify Java packages for which code coverage will be gathered. Use new-line delimited patterns that start with a valid package name and contain *. For example, org.apache.*.

Classes to exclude from instrumentation

Use newline-separated patterns for fully qualified class names to be excluded from the coverage, for example: *Test. Exclude patterns have priority over include patterns.

Last modified: 15 April 2022