Skip to content

Commit

Permalink
.ci/aws: Make failures happen in correct stage
Browse files Browse the repository at this point in the history
Signed-off-by: Seth Zegelstein <[email protected]>
  • Loading branch information
a-szegel committed Aug 15, 2024
1 parent 32daa37 commit 4e9c301
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions .ci/aws/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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"
}
}

Expand Down Expand Up @@ -256,18 +248,6 @@ pipeline {
}
}
}
stage('check build_ok') {
steps {
script {
if (build_ok) {
currentBuild.result = "SUCCESS"
}
else {
currentBuild.result = "FAILURE"
}
}
}
}
}
post {
always {
Expand Down

0 comments on commit 4e9c301

Please sign in to comment.