After they’re done running, builds can display code coverage percentage in the build UI and upload code coverage data.
We currently support SonarQube for coverage bookends. Check with your Screwdriver cluster admin to find what coverage plugins are supported to modify your build execution with.
You can configure Sonar properties in your
sonar-project.properties file or in your screwdriver.yaml as the
$SD_SONAR_OPTS environment variable. The property
sonar.sources is always required, and should be set to your source path.
To use SonarQube, add a
sonar-project.properties file in the root of your source code and add configurations there.
reportPath property depends on the language used. Check the SonarQube documentation to figure out the right syntax.
Alternatively, you can add configurations to the environment variable
- If you define the same property in both the
$SD_SONAR_OPTSwill override the properties file.
- Screwdriver sets the following properties for you:
sonar.links.ci; you must set
- SonarQube properties
- Java example
- Examples from the SonarQube website
- SonarQube docs
- SonarQube environment variables
GitHub pull request decoration
If your Screwdriver cluster supports Sonar Enterprise, you might have the ability to add Pull Request decoration to Checks in GitHub. If this feature is supported, you can enable it by adding the Screwdriver Sonar PR Checks GitHub app to your repository. Check with your Screwdriver cluster admin for support details.