The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

GitHub Pull Request Coverage Status

step([$class: 'CompareCoverageAction']): Publish coverage to GitHub

This step could be used only for Jenkins jobs triggered by GitHub pull request builder plugin

Step will get code coverage from build. Get collected previously coverage for master. Then post status to GitHub pull request as comment.

To record master coverage add post build step Record Master Coverage to any job which you think should be master. Ensure that coverage report is present in a build.

Step get test coverage from Cobertura or Jacoco reports (XML) if they present in build. They could be created by any tool. Otherwise coverage will be 0.
  • jacocoCoverageCounter (optional)
    The coverage metric should be the same as in "Record Master Coverage" action in order to have accurate results
    • Type: String
  • publishResultAs (optional)
    • Type: String
  • scmVars (optional)
    • Type: java.util.Map<java.lang.String, java.lang.String>
  • sonarLogin (optional)
    • Type: String
  • sonarPassword (optional)
    • Type: String

step([$class: 'MasterCoverageAction']): Record Master Coverage

This step get test coverage for repository as master coverage. When you run another build to check pull request. Master coverage will be used co compare vs pull request and post information to pull request comments.

Step get test coverage from Cobertura or Jacoco reports (XML) if they present in build. They could be created by any tool. Otherwise coverage will be 0.
  • jacocoCounterType (optional)
    • Type: String
  • scmVars (optional)
    • Type: java.util.Map<java.lang.String, java.lang.String>

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.