You've already forked jenkins-lib
forked from jenkins/jenkins-lib
Bdd step unstable (#3)
Шаг BDD помечается как Unstable в случае ошибок в сценариях
This commit is contained in:
@@ -70,6 +70,8 @@ interface IStepExecutor {
|
||||
|
||||
def unstash(String name)
|
||||
|
||||
def unstable(String message)
|
||||
|
||||
def zip(String dir, String zipFile)
|
||||
|
||||
def zip(String dir, String zipFile, String glob)
|
||||
|
@@ -154,6 +154,11 @@ class StepExecutor implements IStepExecutor {
|
||||
steps.unstash name
|
||||
}
|
||||
|
||||
@Override
|
||||
def unstable(String message) {
|
||||
steps.unstable message
|
||||
}
|
||||
|
||||
@Override
|
||||
def zip(String dir, String zipFile, String glob = '') {
|
||||
steps.zip dir: dir, zipFile: zipFile, glob: glob, overwrite: true
|
||||
|
@@ -6,9 +6,11 @@ import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
||||
import ru.pulsar.jenkins.library.utils.Logger
|
||||
import ru.pulsar.jenkins.library.utils.VRunner
|
||||
|
||||
import java.lang.reflect.Array
|
||||
|
||||
class Bdd implements Serializable {
|
||||
|
||||
private final JobConfiguration config;
|
||||
private final JobConfiguration config
|
||||
|
||||
Bdd(JobConfiguration config) {
|
||||
this.config = config
|
||||
@@ -29,13 +31,19 @@ class Bdd implements Serializable {
|
||||
steps.installLocalDependencies()
|
||||
|
||||
steps.createDir('build/out')
|
||||
List returnStatuses = []
|
||||
config.bddOptions.vrunnerSteps.each {
|
||||
Logger.println("Шаг запуска сценариев командой ${it}")
|
||||
String vrunnerPath = VRunner.getVRunnerPath()
|
||||
returnStatuses.add(VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"", true) as Integer)
|
||||
}
|
||||
|
||||
steps.catchError {
|
||||
config.bddOptions.vrunnerSteps.each {
|
||||
Logger.println("Шаг запуска сценариев командой ${it}")
|
||||
String vrunnerPath = VRunner.getVRunnerPath();
|
||||
VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"")
|
||||
}
|
||||
if (Collections.max(returnStatuses) > 2) {
|
||||
steps.error("Получен неожиданный/неверный результат работы. Возможно, работа 1С:Предприятие завершилась некорректно, или возникла ошибка при запуске")
|
||||
} else if (returnStatuses.contains(1)) {
|
||||
steps.unstable("Тестирование сценариев завершилось, но часть фич/сценариев упала")
|
||||
} else {
|
||||
Logger.println("Тестирование сценариев завершилось успешно")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user