1
0

Merge pull request #117 from ivanmolodec/develop

Bdd step unstable (#3)
This commit is contained in:
Nikita Fedkin
2024-05-06 19:17:18 +03:00
committed by GitHub
3 changed files with 21 additions and 8 deletions

View File

@@ -70,6 +70,8 @@ interface IStepExecutor {
def unstash(String name) def unstash(String name)
def unstable(String message)
def zip(String dir, String zipFile) def zip(String dir, String zipFile)
def zip(String dir, String zipFile, String glob) def zip(String dir, String zipFile, String glob)

View File

@@ -154,6 +154,11 @@ class StepExecutor implements IStepExecutor {
steps.unstash name steps.unstash name
} }
@Override
def unstable(String message) {
steps.unstable message
}
@Override @Override
def zip(String dir, String zipFile, String glob = '') { def zip(String dir, String zipFile, String glob = '') {
steps.zip dir: dir, zipFile: zipFile, glob: glob, overwrite: true steps.zip dir: dir, zipFile: zipFile, glob: glob, overwrite: true

View File

@@ -8,7 +8,7 @@ import ru.pulsar.jenkins.library.utils.VRunner
class Bdd implements Serializable { class Bdd implements Serializable {
private final JobConfiguration config; private final JobConfiguration config
Bdd(JobConfiguration config) { Bdd(JobConfiguration config) {
this.config = config this.config = config
@@ -27,15 +27,21 @@ class Bdd implements Serializable {
List<String> logosConfig = ["LOGOS_CONFIG=$config.logosConfig"] List<String> logosConfig = ["LOGOS_CONFIG=$config.logosConfig"]
steps.withEnv(logosConfig) { steps.withEnv(logosConfig) {
steps.installLocalDependencies() steps.installLocalDependencies()
steps.createDir('build/out') steps.createDir('build/out')
List<Integer> returnStatuses = []
config.bddOptions.vrunnerSteps.each {
Logger.println("Шаг запуска сценариев командой ${it}")
String vrunnerPath = VRunner.getVRunnerPath()
Integer bddReturnStatus = VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"", true)
returnStatuses.add(bddReturnStatus)
}
steps.catchError { if (Collections.max(returnStatuses) > 2) {
config.bddOptions.vrunnerSteps.each { steps.error("Получен неожиданный/неверный результат работы. Возможно, работа 1С:Предприятие завершилась некорректно, или возникла ошибка при запуске")
Logger.println("Шаг запуска сценариев командой ${it}") } else if (returnStatuses.contains(1)) {
String vrunnerPath = VRunner.getVRunnerPath(); steps.unstable("Тестирование сценариев завершилось, но часть фич/сценариев упала")
VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"") } else {
} Logger.println("Тестирование сценариев завершилось успешно")
} }
} }