Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bdd step unstable (#3) #117

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ru/pulsar/jenkins/library/IStepExecutor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions src/ru/pulsar/jenkins/library/StepExecutor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 15 additions & 7 deletions src/ru/pulsar/jenkins/library/steps/Bdd.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
nixel2007 marked this conversation as resolved.
Show resolved Hide resolved

class Bdd implements Serializable {

private final JobConfiguration config;
private final JobConfiguration config

Bdd(JobConfiguration config) {
this.config = config
Expand All @@ -29,13 +31,19 @@ class Bdd implements Serializable {
steps.installLocalDependencies()

steps.createDir('build/out')
List returnStatuses = []
nixel2007 marked this conversation as resolved.
Show resolved Hide resolved
config.bddOptions.vrunnerSteps.each {
Logger.println("Шаг запуска сценариев командой ${it}")
String vrunnerPath = VRunner.getVRunnerPath()
returnStatuses.add(VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"", true) as Integer)
nixel2007 marked this conversation as resolved.
Show resolved Hide resolved
}

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("Тестирование сценариев завершилось успешно")
}
}

Expand Down