Skip to content

Commit

Permalink
fix coverage paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ovcharenko-di committed Nov 29, 2024
1 parent a8437d2 commit f961320
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/ru/pulsar/jenkins/library/steps/Bdd.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Bdd implements Serializable, Coverable {

steps.lock(coverageContext.lockableResource) {
if (coverageContext != null) {
CoverageUtils.startCoverage(steps, coverageOpts, coverageContext, workspaceDir, srcDir)
CoverageUtils.startCoverage(steps, coverageOpts, coverageContext, workspaceDir, srcDir, this)
}

config.bddOptions.vrunnerSteps.each {
Expand Down
3 changes: 0 additions & 3 deletions src/ru/pulsar/jenkins/library/steps/Coverable.groovy
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package ru.pulsar.jenkins.library.steps

import ru.pulsar.jenkins.library.configuration.StepCoverageOptions

interface Coverable {


String getCoverageStashPath();
String getCoveragePidsPath();

Expand Down
8 changes: 4 additions & 4 deletions src/ru/pulsar/jenkins/library/steps/GetExtensions.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GetExtensions implements Serializable {
public static final String EXTENSIONS_STASH = 'extensions'
public static final String EXTENSIONS_OUT_DIR = 'build/out/cfe'

private final JobConfiguration config;
private final JobConfiguration config

GetExtensions(JobConfiguration config) {
this.config = config
Expand All @@ -29,9 +29,9 @@ class GetExtensions implements Serializable {

def env = steps.env()

steps.installLocalDependencies();
steps.installLocalDependencies()

String vrunnerPath = initVRunnerPath();
String vrunnerPath = initVRunnerPath()

Logger.println("Сборка расширений")

Expand Down Expand Up @@ -88,7 +88,7 @@ class GetExtensions implements Serializable {

private void extractConvertedExtensions(String sourceDirName, IStepExecutor steps) {
if (config.sourceFormat == SourceFormat.EDT) {
// usntash and unzip the edt to designer format transformation
// unstash and unzip the edt to designer format transformation
steps.unstash(EdtToDesignerFormatTransformation.EXTENSION_ZIP_STASH)
steps.unzip(sourceDirName, EdtToDesignerFormatTransformation.EXTENSION_ZIP)
}
Expand Down
2 changes: 1 addition & 1 deletion src/ru/pulsar/jenkins/library/steps/SmokeTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class SmokeTest implements Serializable, Coverable {

steps.lock(coverageContext.lockableResource) {
if (coverageContext != null) {
CoverageUtils.startCoverage(steps, coverageOpts, coverageContext, workspaceDir, srcDir)
CoverageUtils.startCoverage(steps, coverageOpts, coverageContext, workspaceDir, srcDir, this)
}

steps.withEnv(logosConfig) {
Expand Down
2 changes: 1 addition & 1 deletion src/ru/pulsar/jenkins/library/steps/Yaxunit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Yaxunit implements Serializable, Coverable {

steps.lock(coverageContext.lockableResource) {
if (coverageContext != null) {
CoverageUtils.startCoverage(steps, coverageOpts, coverageContext, workspaceDir, srcDir)
CoverageUtils.startCoverage(steps, coverageOpts, coverageContext, workspaceDir, srcDir, this)
}

// Выполняем команды
Expand Down
8 changes: 4 additions & 4 deletions src/ru/pulsar/jenkins/library/utils/CoverageUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import ru.pulsar.jenkins.library.configuration.GlobalCoverageOptions
import ru.pulsar.jenkins.library.configuration.JobConfiguration
import ru.pulsar.jenkins.library.configuration.StepCoverageOptions
import ru.pulsar.jenkins.library.ioc.ContextRegistry
import ru.pulsar.jenkins.library.steps.Coverable
import ru.pulsar.jenkins.library.steps.CoverageContext
import ru.pulsar.jenkins.library.steps.Yaxunit

class CoverageUtils {
static ArrayList<String> getPIDs(String name) {
Expand Down Expand Up @@ -43,9 +43,9 @@ class CoverageUtils {

}

static void startCoverage(IStepExecutor steps, GlobalCoverageOptions coverageOpts, CoverageContext coverageContext, FilePath workspaceDir, String srcDir) {
static void startCoverage(IStepExecutor steps, GlobalCoverageOptions coverageOpts, CoverageContext coverageContext, FilePath workspaceDir, String srcDir, Coverable coverable) {
steps.start("${coverageOpts.dbgsPath} --addr=127.0.0.1 --port=$coverageContext.port")
steps.start("${coverageOpts.coverage41CPath} start -i DefAlias -u http://127.0.0.1:$coverageContext.port -P $workspaceDir -s $srcDir -o $Yaxunit.COVERAGE_STASH_PATH")
steps.start("${coverageOpts.coverage41CPath} start -i DefAlias -u http://127.0.0.1:$coverageContext.port -P $workspaceDir -s $srcDir -o ${coverable.getCoverageStashPath()}")
steps.cmd("${coverageOpts.coverage41CPath} check -i DefAlias -u http://127.0.0.1:$coverageContext.port")

def newDbgsPids = getPIDs("dbgs")
Expand All @@ -57,7 +57,7 @@ class CoverageUtils {
newDbgsPids.addAll(newCoverage41CPids)
def pids = newDbgsPids.join(" ")

steps.writeFile(Yaxunit.COVERAGE_PIDS_PATH, pids, 'UTF-8')
steps.writeFile(coverable.getCoveragePidsPath(), pids, 'UTF-8')

Logger.println("Coverage PIDs for cleanup: $pids")
}
Expand Down

0 comments on commit f961320

Please sign in to comment.