Complete the code to publish a code coverage report using the Jenkins pipeline.
publishCoverage adapters: [coberturaAdapter('**/[1]')], sourceFileResolver: sourceFiles('NEVER_STORE')
The coberturaAdapter expects the coverage report file, commonly named coverage.xml.
Complete the Jenkins pipeline step to fail the build if coverage is below the threshold.
step([$class: 'CoveragePublisher', failUnhealthy: true, [1]: 80])
The correct parameter to set the coverage threshold is coverageThreshold.
Fix the error in the Jenkins pipeline snippet to correctly archive the coverage report.
archiveArtifacts artifacts: '[1]', fingerprint: true
The coverage report file to archive is coverage.xml, which Jenkins expects for coverage plugins.
Fill both blanks to configure the Jenkins pipeline to publish and fail on low coverage.
publishCoverage adapters: [[1]('**/coverage.xml')], failUnhealthy: [2]
Use coberturaAdapter to read the coverage report and set failUnhealthy to true to fail the build if coverage is low.
Fill all three blanks to create a Jenkins pipeline snippet that collects coverage, archives the report, and sets a threshold.
publishCoverage adapters: [[1]('**/coverage.xml')] archiveArtifacts artifacts: '[2]' step([$class: 'CoveragePublisher', [3]: 75])
This snippet uses coberturaAdapter to publish coverage, archives the coverage.xml file, and sets the coverageThreshold to 75%.