Code Coverage

After they’re done running, builds can display code coverage percentage in the build UI and upload code coverage data.

Coverage in build detail page

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 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 file in the root of your source code and add configurations there.

Example file from our Javascript example:


The 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 $SD_SONAR_OPTS.

Example screwdriver.yaml:

    SD_SONAR_OPTS: '-Dsonar.sources=lib -Dsonar.javascript.lcov.reportPaths=artifacts/coverage/'
    requires: [~pr, ~commit]
    image: node:8
      - install: npm install
      - test: npm test


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.