diff --git a/resources/globalConfiguration.json b/resources/globalConfiguration.json index 18a8cca0..693f5544 100644 --- a/resources/globalConfiguration.json +++ b/resources/globalConfiguration.json @@ -84,12 +84,6 @@ }, "yaxunit": { "vrunnerSettings": "./tools/vrunner.json", - "extensions": [ - { - "name":"YAXUNIT", - "src": "https://github.com/bia-technologies/yaxunit/releases/download/23.05/YAXUNIT-23.05.cfe" - } - ], "configPath": "./tools/yaxunit.json", "publishToAllureReport": false, "publishToJUnitReport": true diff --git a/src/ru/pulsar/jenkins/library/configuration/ConfigurationReader.groovy b/src/ru/pulsar/jenkins/library/configuration/ConfigurationReader.groovy index b3dca8f0..a8c71baf 100644 --- a/src/ru/pulsar/jenkins/library/configuration/ConfigurationReader.groovy +++ b/src/ru/pulsar/jenkins/library/configuration/ConfigurationReader.groovy @@ -82,7 +82,6 @@ class ConfigurationReader implements Serializable { mergeObjects(baseConfiguration, configurationToMerge, nonMergeableSettings) mergeInitInfoBaseOptions(baseConfiguration.initInfoBaseOptions, configurationToMerge.initInfoBaseOptions) mergeBddOptions(baseConfiguration.bddOptions, configurationToMerge.bddOptions) - mergeYaxunitOptions(baseConfiguration.yaxunitOptions, configurationToMerge.yaxunitOptions) mergeSyntaxCheckOptions(baseConfiguration.syntaxCheckOptions, configurationToMerge.syntaxCheckOptions) mergeNotificationsOptions(baseConfiguration.notificationsOptions, configurationToMerge.notificationsOptions) @@ -149,14 +148,6 @@ class ConfigurationReader implements Serializable { baseObject.vrunnerSteps = objectToMerge.vrunnerSteps.clone() } - @NonCPS - private static void mergeYaxunitOptions(YaxunitOptions baseObject, YaxunitOptions objectToMerge) { - if (objectToMerge == null || objectToMerge.extensions == null) { - return - } - baseObject.extensions = objectToMerge.extensions.clone() - } - @NonCPS private static void mergeSyntaxCheckOptions(SyntaxCheckOptions baseObject, SyntaxCheckOptions objectToMerge) { if (objectToMerge == null || objectToMerge.checkModes == null) { diff --git a/src/ru/pulsar/jenkins/library/configuration/Extension.groovy b/src/ru/pulsar/jenkins/library/configuration/Extension.groovy deleted file mode 100644 index 51e04d21..00000000 --- a/src/ru/pulsar/jenkins/library/configuration/Extension.groovy +++ /dev/null @@ -1,17 +0,0 @@ -package ru.pulsar.jenkins.library.configuration - -import com.cloudbees.groovy.cps.NonCPS -import com.fasterxml.jackson.annotation.JsonIgnoreProperties - -@JsonIgnoreProperties(ignoreUnknown = true) -class Extension implements Serializable { - String name - String src - - @Override - @NonCPS - String toString() { - return name - } - -} diff --git a/src/ru/pulsar/jenkins/library/configuration/YaxunitOptions.groovy b/src/ru/pulsar/jenkins/library/configuration/YaxunitOptions.groovy index 1001187c..c285fa1a 100644 --- a/src/ru/pulsar/jenkins/library/configuration/YaxunitOptions.groovy +++ b/src/ru/pulsar/jenkins/library/configuration/YaxunitOptions.groovy @@ -2,7 +2,6 @@ package ru.pulsar.jenkins.library.configuration import com.cloudbees.groovy.cps.NonCPS import com.fasterxml.jackson.annotation.JsonIgnoreProperties -import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonPropertyDescription @JsonIgnoreProperties(ignoreUnknown = true) @@ -13,15 +12,6 @@ class YaxunitOptions implements Serializable { """) String vrunnerSettings = "./tools/vrunner.json" - @JsonProperty("extensions") - @JsonPropertyDescription("""Расширения с тестами. - Массив объектов с полями name и src, где - name - имя расширения - src - путь к расширению (к cfe или к исходникам) - По умолчанию содержит один элемент - YAXUNIT версии 23.05. - """) - Extension[] extensions - @JsonPropertyDescription("""Путь к конфигурационному файлу YAXUnit. По умолчанию содержит значение "./tools/yaxunit.json". """) @@ -40,10 +30,11 @@ class YaxunitOptions implements Serializable { @Override @NonCPS String toString() { - return "YaxunitTestOptions{" + + return "YaxunitOptions{" + "vrunnerSettings='" + vrunnerSettings + '\'' + - ", extensions='" + extensions + ", configPath='" + configPath + + ", publishToAllureReport='" + publishToAllureReport + + ", publishToJUnitReport='" + publishToJUnitReport + '}' } } diff --git a/src/ru/pulsar/jenkins/library/steps/Yaxunit.groovy b/src/ru/pulsar/jenkins/library/steps/Yaxunit.groovy index 7549ed10..2587d0bb 100644 --- a/src/ru/pulsar/jenkins/library/steps/Yaxunit.groovy +++ b/src/ru/pulsar/jenkins/library/steps/Yaxunit.groovy @@ -2,7 +2,7 @@ package ru.pulsar.jenkins.library.steps import hudson.FilePath import ru.pulsar.jenkins.library.IStepExecutor -import ru.pulsar.jenkins.library.configuration.Extension + import ru.pulsar.jenkins.library.configuration.JobConfiguration import ru.pulsar.jenkins.library.ioc.ContextRegistry import ru.pulsar.jenkins.library.utils.FileUtils @@ -42,34 +42,6 @@ class Yaxunit implements Serializable { String vrunnerPath = VRunner.getVRunnerPath() String ibConnection = ' --ibconnection "/F./build/ib"' - def extCommands = [] - - // Команда загрузки YAXUnit - def loadYaxunitCommand = VRunner.loadExtCommand("yaxunit") - extCommands << loadYaxunitCommand - - // Команды сборки расширений с тестами и их загрузки в ИБ - for (Extension extension in options.extensions) { - if (extension.src.endsWith('cfe')) { - // Скачиваем расширение - String pathToExtension = "$env.WORKSPACE/build/out/${extension.name}.cfe" - FilePath localPathToExtension = FileUtils.getFilePath(pathToExtension) - Logger.println("Скачивание расширения $extension.name в $localPathToExtension из ${extension.src}") - localPathToExtension.copyFrom(new URL(extension.src)) - } else { - // Команда компиляции в cfe - def compileExtCommand = "$vrunnerPath compileexttocfe --src $extension.src --out build/out/${extension.name}.cfe" - extCommands << compileExtCommand - Logger.println("Команда сборки расширения: $compileExtCommand") - } - - // Команда загрузки расширения в ИБ - def loadTestExtCommand = VRunner.loadExtCommand(extension.name) - extCommands << loadTestExtCommand - Logger.println("Команда загрузки расширения: $loadTestExtCommand") - - } - // Готовим конфиг для yaxunit String yaxunitConfigPath = options.configPath if (!steps.fileExists(yaxunitConfigPath)) { @@ -83,20 +55,15 @@ class Yaxunit implements Serializable { // Переопределяем настройки vrunner String vrunnerSettings = options.vrunnerSettings - String[] extCommandsWithSettings = extCommands if (steps.fileExists(vrunnerSettings)) { String vrunnerSettingsParam = " --settings $vrunnerSettings" - extCommandsWithSettings = extCommands.collect { "$it $vrunnerSettingsParam" } runTestsCommand += vrunnerSettingsParam } // Выполяем команды steps.withEnv(logosConfig) { - for (extCommand in extCommandsWithSettings) { - VRunner.exec(extCommand, true) - } VRunner.exec(runTestsCommand, true) } diff --git a/src/ru/pulsar/jenkins/library/utils/VRunner.groovy b/src/ru/pulsar/jenkins/library/utils/VRunner.groovy index ce065556..ebce6fe4 100644 --- a/src/ru/pulsar/jenkins/library/utils/VRunner.groovy +++ b/src/ru/pulsar/jenkins/library/utils/VRunner.groovy @@ -1,6 +1,5 @@ package ru.pulsar.jenkins.library.utils -import hudson.FilePath import ru.pulsar.jenkins.library.IStepExecutor import ru.pulsar.jenkins.library.ioc.ContextRegistry @@ -40,25 +39,4 @@ class VRunner { return fileContent.contains("\"$settingName\"") } - static String loadExtCommand(String name) { - - IStepExecutor steps = ContextRegistry.getContext().getStepExecutor() - - def env = steps.env() - def vrunnerPath = getVRunnerPath() - - String pathToExt = "$env.WORKSPACE/build/out/${name}.cfe" - FilePath localPathToExt = FileUtils.getFilePath(pathToExt) - - // Команда загрузки расширения - String loadCommand = vrunnerPath + ' run --command "Путь=' + localPathToExt + ';ЗавершитьРаботуСистемы;" --execute ' - String executeParameter = '$runnerRoot/epf/ЗагрузитьРасширениеВРежимеПредприятия.epf' - if (steps.isUnix()) { - executeParameter = '\\' + executeParameter - } - loadCommand += executeParameter - loadCommand += ' --ibconnection "/F./build/ib"' - - return loadCommand - } }