From 1d4cbaa1ed74fd3d4748a4636c3f6d57805bc24b Mon Sep 17 00:00:00 2001 From: Lukasz Sojka Date: Tue, 3 Dec 2024 16:05:53 +0100 Subject: [PATCH] fix(pipeline): fail ci on provision error When provision step fails there's usually no point in progressing to another step as it probably also fail. fix by stopping catching errors in provision step. fixes: https://github.com/scylladb/scylla-cluster-tests/issues/9083 --- vars/longevityPipeline.groovy | 43 +++++++++++++--------- vars/perfRegressionParallelPipeline.groovy | 24 ++++++------ 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/vars/longevityPipeline.groovy b/vars/longevityPipeline.groovy index 750e94a621..269afa0d28 100644 --- a/vars/longevityPipeline.groovy +++ b/vars/longevityPipeline.groovy @@ -290,24 +290,22 @@ def call(Map pipelineParams) { } stage('Provision Resources') { steps { - catchError(stageResult: 'FAILURE') { - script { - wrap([$class: 'BuildUser']) { - dir('scylla-cluster-tests') { - timeout(time: 30, unit: 'MINUTES') { - if (params.backend == 'aws' || params.backend == 'azure') { - provisionResources(params, builder.region) - } else if (params.backend.contains('docker')) { - sh """ - echo 'Tests are to be executed on Docker backend in SCT-Runner. No additional resources to be provisioned.' - """ - } else { - sh """ - echo 'Skipping because non-AWS/Azure backends are not supported' - """ - } - completed_stages['provision_resources'] = true + script { + wrap([$class: 'BuildUser']) { + dir('scylla-cluster-tests') { + timeout(time: 30, unit: 'MINUTES') { + if (params.backend == 'aws' || params.backend == 'azure') { + provisionResources(params, builder.region) + } else if (params.backend.contains('docker')) { + sh """ + echo 'Tests are to be executed on Docker backend in SCT-Runner. No additional resources to be provisioned.' + """ + } else { + sh """ + echo 'Skipping because non-AWS/Azure backends are not supported' + """ } + completed_stages['provision_resources'] = true } } } @@ -455,6 +453,17 @@ def call(Map pipelineParams) { } } } + if (!completed_stages['clean_sct_runner']) { + catchError { + script { + wrap([$class: 'BuildUser']) { + dir('scylla-cluster-tests') { + cleanSctRunners(params, currentBuild) + } + } + } + } + } if (!completed_stages['send_email']) { catchError { script { diff --git a/vars/perfRegressionParallelPipeline.groovy b/vars/perfRegressionParallelPipeline.groovy index 309af5ec43..290b0b89db 100644 --- a/vars/perfRegressionParallelPipeline.groovy +++ b/vars/perfRegressionParallelPipeline.groovy @@ -283,23 +283,21 @@ def call(Map pipelineParams) { } stage("Provision Resources for ${sub_test}") { - catchError(stageResult: 'FAILURE') { - script { - wrap([$class: 'BuildUser']) { - dir('scylla-cluster-tests') { - timeout(time: 30, unit: 'MINUTES') { - if (params.backend == 'aws' || params.backend == 'azure') { - provisionResources(new_params, builder.region) - } else { - sh """ - echo 'Skipping because non-AWS/Azure backends are not supported' - """ - } - } + script { + wrap([$class: 'BuildUser']) { + dir('scylla-cluster-tests') { + timeout(time: 30, unit: 'MINUTES') { + if (params.backend == 'aws' || params.backend == 'azure') { + provisionResources(new_params, builder.region) + } else { + sh """ + echo 'Skipping because non-AWS/Azure backends are not supported' + """ } } } } + } } stage("Run ${sub_test}"){