Skip to content

Commit

Permalink
fix(pipeline): fail ci on provision error
Browse files Browse the repository at this point in the history
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: #9083
  • Loading branch information
soyacz authored and fruch committed Dec 4, 2024
1 parent e6dca7e commit 1d4cbaa
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
43 changes: 26 additions & 17 deletions vars/longevityPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down Expand Up @@ -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 {
Expand Down
24 changes: 11 additions & 13 deletions vars/perfRegressionParallelPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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}"){
Expand Down

0 comments on commit 1d4cbaa

Please sign in to comment.