code-coverage-api-plugin
code-coverage-api-plugin copied to clipboard
Pipeline Examples for showcasing
Even though you can generate snippets with the generator, it might be easier to showcase the functionality directly somewhere on the project page. This helps Jenkins admins if this plugin is useful for their project.
publishCoverage(
adapters: [
jacocoAdapter(
path: 'target/site/jacoco/jacoco.xml',
mergeToOneReport: false,
thresholds: [[
thresholdTarget: 'Function',
unhealthyThreshold: 0.0,
unstableThreshold: 0.0,
failUnhealthy: false
]]
),
istanbulCoberturaAdapter(
path: 'path/to/cobertura-coverage.xml',
thresholds: [[
thresholdTarget: 'Function',
unhealthyThreshold: 0.0,
unstableThreshold: 0.0,
failUnhealthy: false
]]
)
],
globalThresholds: [[
thresholdTarget: 'Function',
unhealthyThreshold: 0.0,
unstableThreshold: 0.0,
failUnhealthy: false
]],
failUnhealthy: false,
failUnstable: false,
failNoReports: false,
sourceFileResolver: sourceFiles('NEVER_STORE'),
tag: 'tag',
calculateDiffForChangeRequests: false,
failBuildIfCoverageDecreasedInChangeRequest: false,
applyThresholdRecursively: false
)
Should then include example for both Scripted and Declarative Pipeline