code-coverage-api-plugin icon indicating copy to clipboard operation
code-coverage-api-plugin copied to clipboard

Pipeline Examples for showcasing

Open thatsIch opened this issue 5 years ago • 1 comments

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
)

thatsIch avatar Apr 24 '20 20:04 thatsIch

Should then include example for both Scripted and Declarative Pipeline

DJViking avatar Apr 28 '20 21:04 DJViking