From 0592acb2a7d49f2278b073fa953cf7076e03492e Mon Sep 17 00:00:00 2001 From: Seth Zegelstein Date: Thu, 15 Aug 2024 17:55:16 +0000 Subject: [PATCH] .ci/aws: Make failures happen in correct stage Signed-off-by: Seth Zegelstein --- .ci/aws/Jenkinsfile | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/.ci/aws/Jenkinsfile b/.ci/aws/Jenkinsfile index 41f87b296..0d0a0c581 100644 --- a/.ci/aws/Jenkinsfile +++ b/.ci/aws/Jenkinsfile @@ -6,9 +6,6 @@ if (buildNumber > 1) milestone(buildNumber - 1) milestone(buildNumber) -import groovy.transform.Field -@Field boolean build_ok = true - def get_portafiducia_download_path() { /* Stable Portafiducia tarball */ def AWS_ACCOUNT_ID = sh ( @@ -84,16 +81,11 @@ def run_test_orchestrator_once(run_name, build_tag, os, instance_type, instance_ def cluster_name = get_cluster_name(build_tag, os, instance_type) def args = "--os ${os} --odcr ${odcr} --instance-type ${instance_type} --instance-count ${instance_count} --region ${region} --cluster-name ${cluster_name} ${addl_args} --junit-xml outputs/${cluster_name}.xml" - def ret = sh ( - script: ". venv/bin/activate; ./PortaFiducia/tests/test_orchestrator.py ${args}", - returnStatus: true - ) - if (ret == 65) - unstable('Scripts exited with status 65') - else if (ret != 0) - build_ok = false - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh "exit ${ret}" + + try { + sh ". venv/bin/activate; ./PortaFiducia/tests/test_orchestrator.py ${args}" + } catch (Exception e) { + currentBuild.result = "FAILURE" } } @@ -256,18 +248,6 @@ pipeline { } } } - stage('check build_ok') { - steps { - script { - if (build_ok) { - currentBuild.result = "SUCCESS" - } - else { - currentBuild.result = "FAILURE" - } - } - } - } } post { always {