TeamCity Plugin for IntelliJ Platform Help 2021.2 Help

Working with Code Coverage

The TeamCity Plugin for IntelliJ IDEA provides access to the server-side code coverage information and visualizes the portions of the code covered by unit tests. Prior to using this feature, make sure that recording code coverage data is enabled in your run configuration. By default, code coverage marking is visible in the gutter area. The covered lines are marked in green img, partially covered - in yellow img, and uncovered lines are marked in red img.

When showing code coverage is enabled, the Project view of the IDE shows the percentage of classes and lines covered by unit tests:

img

This section describes how to:

To enable code coverage highlighting

  1. In the IDEA IDE, on the Analyze menu, click Show Code Coverage Data, or use the Ctrl+Alt+F6 keyboard shortcut.

  2. In the Code Coverage Suites dialog, select the desired suite:

    img

To disable code coverage highlighting

  1. In the IDEA IDE, on the Analyze menu, click Show Code Coverage Data, or use the Ctrl+Alt+F6 keyboard shortcut.

  2. In the Code Coverage Suites dialog, choose No coverage.

To configure code coverage highlighting

  1. Open the Color and Fonts dialog (File | Settings | IDE Settings | Editor | Colors and Fonts | Java).

  2. Select the desired color scheme.

  3. In the Java tab, set up highlighting color and style for the following options: Full line coverage, Partial line coverage, and Uncovered line.

Last modified: 04 April 2024