Skip to content

Commit

Permalink
Merge branch 'develop' into yaxunit-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
ovcharenko-di committed May 7, 2024
2 parents e92dc31 + f60feb2 commit a7eca18
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pipeline1C()
## Внешний вид пайплайна в интерфейсе Blue Ocean

![image](https://github.com/firstBitMarksistskaya/jenkins-lib/assets/80944823/e34a0112-2fe5-4116-92ac-8fcca08bba43)
![image](https://github.com/firstBitMarksistskaya/jenkins-lib/assets/80944823/a8d5bdff-3267-4744-a613-8c3d445b767f)

## Конфигурирование

Expand Down
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 @@ -72,6 +72,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 @@ -159,6 +159,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: 14 additions & 8 deletions src/ru/pulsar/jenkins/library/steps/Bdd.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ru.pulsar.jenkins.library.utils.VRunner

class Bdd implements Serializable {

private final JobConfiguration config;
private final JobConfiguration config

Bdd(JobConfiguration config) {
this.config = config
Expand All @@ -27,15 +27,21 @@ class Bdd implements Serializable {
List<String> logosConfig = ["LOGOS_CONFIG=$config.logosConfig"]
steps.withEnv(logosConfig) {
steps.installLocalDependencies()

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 {
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
19 changes: 10 additions & 9 deletions vars/pipeline1C.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -106,31 +106,32 @@ void call() {
}
}

stage('Инициализация ИБ') {
stage('Загрузка расширений в конфигурацию'){
when {
beforeAgent true
expression { config.stageFlags.initSteps }
expression { config.needLoadExtensions() }
}
steps {
timeout(time: config.timeoutOptions.initInfoBase, unit: TimeUnit.MINUTES) {
// Инициализация и первичная миграция
initInfobase config
timeout(time: config.timeoutOptions.loadExtensions, unit: TimeUnit.MINUTES) {
loadExtensions config
}
}
}

stage('Загрузка расширений в конфигурацию'){
stage('Инициализация ИБ') {
when {
beforeAgent true
expression { config.needLoadExtensions() }
expression { config.stageFlags.initSteps }
}
steps {
timeout(time: config.timeoutOptions.loadExtensions, unit: TimeUnit.MINUTES) {
loadExtensions config
timeout(time: config.timeoutOptions.initInfoBase, unit: TimeUnit.MINUTES) {
// Инициализация и первичная миграция
initInfobase config
}
}
}


stage('Архивация ИБ') {
steps {
timeout(time: config.timeoutOptions.zipInfoBase, unit: TimeUnit.MINUTES) {
Expand Down

0 comments on commit a7eca18

Please sign in to comment.