Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.08 KB

File metadata and controls

39 lines (27 loc) · 1.08 KB

Pipeline: Coverage Results Plugin

The plugin adds a pipeline step to access code coverage results.

Currently supported coverage providers:

Usage

The method getCoverageResult can be used to access code coverage results.

  • Parameter element: the coverage element: e.g. 'Line', 'Conditional' (depends on used coverage adapter)
  • Return: Integer value representing the coverage in percent (-1 if no coverage results were found)

If no parameter element is given it defaults to 'Line'.

Examples

These are examples for use with the code-coverage-api-plugin which provides 'Line' and 'Conditional' coverage elements for all adapters.

Line coverage

def lineCoverage = getCoverage('Line');

Branch coverage

def conditionCoverage = getCoverage('Conditional');

Line coverage delta

def lineCoverageDelta = getCoverageDelta('Line');

Branch coverage delta

def conditionCoverageDelta = getCoverageDelta('Conditional');