Test coverage parameters
On this page
Test coverage reports describe the percentage of your code that has been tested by your test suite during a build.
This differs from test execution reports, which describe which tests within your test suite have been run during a build. For details, see test execution parameters.
Test coverage reports are not generated by SonarQube Community Build itself. They must be generated by an external tool and then imported into SonarQube Community Build by specifying a parameter telling the scanner where to look for the report. The data is then displayed in your SonarQube Community Build analysis.
Below, you will find language- and tool-specific analysis parameters for importing test coverage reports.
For information on analysis parameters in general, see analysis parameters.
Unless otherwise specified, these properties require values that are relative to the project root. Some properties support the following wildcards in paths. The remarks for properties that support wildcards will mention this fact. If wildcards are not noted for a given property, then they are not supported for that property.
Symbol | Meaning |
? | a single character |
* | any number of characters |
** | any number of directories |
All languages
sonar.coverageReportPaths
- Comma-delimited list of paths to coverage reports in the generic test data format.
Flex
sonar.flex.cobertura.reportPaths
- Path to the Cobertura XML reports. Multiple paths may be comma-delimited. May be absolute or relative to the project base directory.
Go
sonar.go.coverage.reportPaths
- Comma-delimited list of paths to coverage report files. Wildcards are supported.
Java/Kotlin/Scala/JVM
See Java test coverage for examples and details.
sonar.coverage.jacoco.xmlReportPaths
- Comma-delimited list of paths to JaCoCo XML coverage reports. Wildcards are supported.
sonar.jacoco.reportPaths
- Deprecated. Use
sonar.coverage.jacoco.xmlReportPaths
instead.
JavaScript/TypeScript
See JavaScript/TypeScript test coverage for examples and details.
sonar.javascript.lcov.reportPaths
- Comma-delimited list of paths to LCOV coverage report files. Paths may be absolute or relative to the project root.
PHP
See PHP test coverage for examples and details.
sonar.php.coverage.reportPaths
- Comma-delimited list of paths to Clover XML-format coverage report files. Paths may be absolute or relative to the project root.
Python
See Python test coverage for examples and details.
sonar.python.coverage.reportPaths
- Comma-delimited list of paths to coverage reports in the Cobertura XML format. Wildcards are supported. Leave unset to use the default,
coverage-reports/*coverage-*.xml
.
Ruby
sonar.ruby.coverage.reportPaths
- Comma-delimited list of paths to SimpleCov report files generated with the JSON formatter (available from SimpleCov 0.20). For SimpleCov versions before 0.18, you can provide
.resultset.json
report files (though we recommend updating to 0.20 and using the JSON formatter). Paths may be absolute or relative to the project root. - When using the
simplecov_json_formatter
from simplecov >= v0.20, add
-D sonar.ruby.coverage.reportPaths=coverage/coverage.json \
to your SonarScanner code.
Scala
sonar.scala.coverage.reportPaths
- Comma-delimited list of paths to
scoverage.xml
report files generated by Scoverage.
VB.NET
See .NET test coverage for examples and details.
sonar.vbnet.vscoveragexml.reportsPaths
- Comma-delimited list of paths to Visual Studio Code Coverage reports. Wildcards are supported.
sonar.vbnet.dotcover.reportsPaths
- Comma-delimited list of paths to dotCover coverage reports.
sonar.vbnet.opencover.reportsPaths
- Comma-delimited list of paths to OpenCover coverage reports.
Was this page helpful?