You can collect coverage information during unit test execution by running Jtest goals (Maven) or tasks (Ant and Gradle).
Unit Tests built-in test configuration: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 fill in 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].
When coverage collection is configured and you collect coverage from unit tests, a static image of your project is also available. This image can be used to fill in additional coverage images in DTP, for example, images dedicated to manual or other types of tests, so that no additional scan is needed. You can specify a set of tags that will be used to send the static portion of coverage to specified images in DTP with the report.coverage.static.images property:
report.coverage.static.images=[tag1; tag2; tag3] |
When these tags are set, the corresponding coverage images in DTP will be automatically filled with data as separate coverage reports.
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.