Skip to content

Commit

Permalink
yaxunit coverage cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ovcharenko-di committed Sep 1, 2024
1 parent 8f948c2 commit 117ef58
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/ru/pulsar/jenkins/library/steps/CoverageCleanup.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package ru.pulsar.jenkins.library.steps

import ru.pulsar.jenkins.library.IStepExecutor
import ru.pulsar.jenkins.library.configuration.JobConfiguration
import ru.pulsar.jenkins.library.ioc.ContextRegistry
import ru.pulsar.jenkins.library.utils.Logger

class CoverageCleanup implements Serializable {

private final JobConfiguration config;

private String encoding = 'UTF-8'

CoverageCleanup(JobConfiguration config) {
this.config = config
}

def run() {
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()

Logger.printLocation()

if (steps.isUnix()) {
def command = "pkill Coverage41C && pkill dbgs"
steps.sh(command, false, false, encoding)
} else {
def command = "taskkill /IM Coverage41C /F & taskkill /IM dbgs /F"
steps.sh(command, false, false, encoding)
}
}
}
11 changes: 11 additions & 0 deletions vars/coverageCleanup.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import ru.pulsar.jenkins.library.configuration.JobConfiguration
import ru.pulsar.jenkins.library.ioc.ContextRegistry
import ru.pulsar.jenkins.library.steps.CoverageCleanup

def call(JobConfiguration config) {
ContextRegistry.registerDefaultContext(this)

def coverageCleanup = new CoverageCleanup(config);
coverageCleanup.run()

}
5 changes: 5 additions & 0 deletions vars/pipeline1C.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ void call() {
yaxunit config
}
}
post('yaxunit-coverage-cleanup') {
always {
coverageCleanup config
}
}
}
}
}
Expand Down

0 comments on commit 117ef58

Please sign in to comment.