Skip to content

Commit

Permalink
contrib/aws: Make Jenkins failures happen in place
Browse files Browse the repository at this point in the history
Before this commit, when Jenkins used to have a failure, Jenkins would
make a big red box (mark the failure) around the cleanup shell script.
This change moves the big red box to be around the execution logs
holding the job error. This is a cosmetic fix.

Signed-off-by: Seth Zegelstein <szegel@amazon.com>
  • Loading branch information
a-szegel committed Aug 30, 2024
1 parent 8b26d8c commit 6f616b1
Showing 1 changed file with 17 additions and 40 deletions.
57 changes: 17 additions & 40 deletions contrib/aws/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ def buildNumber = env.BUILD_NUMBER as int
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 @@ -54,17 +49,12 @@ def run_test_orchestrator_once(run_name, build_tag, os, instance_type, instance_
* param@ args: str, the command line arguments
*/
def cluster_name = get_cluster_name(build_tag, os, instance_type)
def args = "--config configs/${test_config_file} --os ${os} --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; cd 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}"
def args = "--config PortaFiducia/tests/configs/${test_config_file} --os ${os} --instance-type ${instance_type} --instance-count ${instance_count} --region ${region} --cluster-name ${cluster_name} ${addl_args} --junit-xml outputs/${cluster_name}.xml"
try {
sh ". venv/bin/activate; ./PortaFiducia/tests/test_orchestrator.py ${args}"
} catch (Exception e){
currentBuild.result = "FAILURE"
throw e
}
}

Expand Down Expand Up @@ -103,20 +93,19 @@ def get_single_node_windows_test_stage(stage_name) {
return {
stage("${stage_name}") {
def ret = sh (
script: """
. venv/bin/activate;
cd PortaFiducia/scripts;
export PULL_REQUEST_ID=${env.CHANGE_ID};
env AWS_DEFAULT_REGION=us-west-2 ./test_orchestrator_windows.py --ci public --s3-bucket-name libfabric-ci-windows-prod-test-output --pull-request-id ${env.CHANGE_ID};
""",
script: ,
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;
cd PortaFiducia/scripts;
export PULL_REQUEST_ID=${env.CHANGE_ID};
env AWS_DEFAULT_REGION=us-west-2 ./test_orchestrator_windows.py --ci public --s3-bucket-name libfabric-ci-windows-prod-test-output --pull-request-id ${env.CHANGE_ID};
"""
} catch (Exception e){
currentBuild.result = "FAILURE"
throw e
}
}
}
Expand Down Expand Up @@ -234,18 +223,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 6f616b1

Please sign in to comment.