Collecting Coverage Information

You can collect coverage information during unit test execution by running Jtest goals (Maven) or tasks (Ant and Gradle).

  1. Configure the Jtest plugin for your build system:
    Configuring the Jtest Plugin for Maven
    Configuring the Jtest Plugin for Gradle
    Configuring the Jtest Plugin for Ant

  2. Execute your tests with the dedicated Jtest goals or tasks and the Unit Tests built-in test configuration:
    Collecting Coverage for Unit Tests with Maven
    Collecting Coverage for Unit Tests with Gradle
    Collecting Coverage for Unit Tests with Ant

Sending Coverage Information to DTP

The Unit Tests test configuration automatically sends the results to DTP. To ensure the coverage data is properly merged, you must specify one or more coverage image tags in the command line or .properties settings file. The coverage image(s) is automatically sent to the connected DTP server where it can be associated with a filter. 

You can specify a set of up to three tags that can be used to create coverage images in DTP Server with the report.coverage.images property: 

report.coverage.images=[tag1; tag2; tag3]

Associate coverage images in DTP in the Report Center administration page (administration> Projects> Filters> [filter]).

You can also use the report.coverage.limit property to specify a lower coverage threshold:

report.coverage.limit=[value]

Coverage results lower than this value are highlighted in the report. The default value is 40

  • No labels