Skip to content

Commit

Permalink
Update src/ru/pulsar/jenkins/library/steps/WithCoverage.groovy
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
nixel2007 and coderabbitai[bot] authored Dec 1, 2024
1 parent f758456 commit f17c9ae
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/ru/pulsar/jenkins/library/steps/WithCoverage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ class WithCoverage implements Serializable {

//noinspection GroovyMissingReturnStatement
steps.lock(context.lockableResource) {
if (coverageOptions.coverage) {
CoverageUtils.startCoverage(steps, config, context, stage)
}

body()

if (coverageOptions.coverage) {
CoverageUtils.stopCoverage(steps, config, context)
try {
if (coverageOptions.coverage) {
CoverageUtils.startCoverage(steps, config, context, stage)
}

body()
} finally {
if (coverageOptions.coverage) {
CoverageUtils.stopCoverage(steps, config, context)
}
}
}

Expand Down

0 comments on commit f17c9ae

Please sign in to comment.