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.

Code Coverage Plugin

publishCoverage: Publish Coverage Report [deprecated]

  • adapters (optional)
      Array / List of Nested Choice of Objects
    • antPath
      • path : String
    • dListingAdapter
      • path : String
      • mergeToOneReport : boolean (optional)
      • thresholds (optional)
          Array / List of Nested Object
        • thresholdTarget : String
        • failUnhealthy : boolean (optional)
        • unhealthyThreshold : float (optional)
        • unstableThreshold : float (optional)
    • istanbulCoberturaAdapter
      • path : String
      • mergeToOneReport : boolean (optional)
      • thresholds (optional)
          Array / List of Nested Object
        • thresholdTarget : String
        • failUnhealthy : boolean (optional)
        • unhealthyThreshold : float (optional)
        • unstableThreshold : float (optional)
    • jacocoAdapter
      • path : String
      • mergeToOneReport : boolean (optional)
      • thresholds (optional)
          Array / List of Nested Object
        • thresholdTarget : String
        • failUnhealthy : boolean (optional)
        • unhealthyThreshold : float (optional)
        • unstableThreshold : float (optional)
    • llvmAdapter
      • path : String
      • mergeToOneReport : boolean (optional)
      • thresholds (optional)
          Array / List of Nested Object
        • thresholdTarget : String
        • failUnhealthy : boolean (optional)
        • unhealthyThreshold : float (optional)
        • unstableThreshold : float (optional)
    • opencoverAdapter
      • path : String
      • mergeToOneReport : boolean (optional)
      • thresholds (optional)
          Array / List of Nested Object
        • thresholdTarget : String
        • failUnhealthy : boolean (optional)
        • unhealthyThreshold : float (optional)
        • unstableThreshold : float (optional)
    • sonarGenericCoverageAdapter
      • path : String
      • mergeToOneReport : boolean (optional)
      • thresholds (optional)
          Array / List of Nested Object
        • thresholdTarget : String
        • failUnhealthy : boolean (optional)
        • unhealthyThreshold : float (optional)
        • unstableThreshold : float (optional)
    • coberturaAdapter
      • path : String
      • mergeToOneReport : boolean (optional)
      • thresholds (optional)
          Array / List of Nested Object
        • thresholdTarget : String
        • failUnhealthy : boolean (optional)
        • unhealthyThreshold : float (optional)
        • unstableThreshold : float (optional)
    • cobertura
      • path : String
      • mergeToOneReport : boolean (optional)
      • thresholds (optional)
          Array / List of Nested Object
        • thresholdTarget : String
        • failUnhealthy : boolean (optional)
        • unhealthyThreshold : float (optional)
        • unstableThreshold : float (optional)
  • applyThresholdRecursively : boolean (optional)
    By default, this plugins will only apply threshold at report level. If this option is set to true, it will apply threshold to all levels. For example, if this option is true, and if you have specified a `Line` threshold, this plugin will check all modules, directories, files...
  • calculateDiffForChangeRequests : boolean (optional)
    If it is a change request build, calculate code coverage diff with a target branch build
  • checksName : String (optional)
    If provided, and publishing checks enabled, the plugin will use this name when publishing results to corresponding SCM hosting platforms. If not, the default of "Code Coverage" will be used.
  • failBuildIfCoverageDecreasedInChangeRequest : boolean (optional)
    Fail the build in case if code coverage decreased in comparison with the target branch
  • failNoReports : boolean (optional)
    Fail the build if no coverage reports found.
  • failUnhealthy : boolean (optional)
    Fail the step if coverage is lower than healthy threshold.
  • failUnstable : boolean (optional)
    Fail the build if coverage is lower than stable threshold.
  • globalThresholds (optional)
      Array / List of Nested Object
    • thresholdTarget : String
    • failUnhealthy : boolean (optional)
    • unhealthyThreshold : float (optional)
    • unstableThreshold : float (optional)
  • scm : String (optional)
  • skipPublishingChecks : boolean (optional)
    If unchecked, the plugin will automatically publish the coverage to corresponding SCM platforms. For example, if you are using this feature for a GitHub organization project, the coverage will be published to GitHub through the Checks API.
  • sourceCodeEncoding : String (optional)
    In order to correctly show all your affected source code files in the detail views, the plugin must open these files with the correct character encoding (UTF-8, ISO-8859-1, etc.). If you leave this field empty then the default encoding of the platform will be used. This might work but is not recommended.
  • sourceDirectories (optional)
    Since the plugin also reads the affected source code files it needs to copy these files from the agent to the controller. If these files are not part of the workspace (or checked out into a sub folder of the workspace) they are not automatically found. So you can add one or more source code directories where the plugin tries to find these files. Note, that due to security restrictions additional paths outside the workspace need to be registered in Jenkins system configuration before they can be used here.
      Array / List of Nested Object
    • path : String
      Select the path to your source code files. This plugin copies source code files to Jenkins' build folder so that these files can be rendered in the user interface together with the plugin results. If these files are referenced with relative paths then they cannot be found by the plugin. In these cases you need to specify one or more relative paths within the workspace where the plugin can locate them. Alternatively, you can also specify absolute paths if the source code files are stored outside the workspace (in a directory on the agent). All absolute paths must be additionally approved by an administrator in Jenkins' global configuration page.
  • sourceFileResolver (optional)
      Nested Object
    • level
      • Values: NEVER_STORE, STORE_LAST_BUILD, STORE_ALL_BUILD
  • tag : String (optional)

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.