Skip to content

Commit

Permalink
[v1.12.x-aws] .ci/aws: Small cleanup to Jenkinsfile
Browse files Browse the repository at this point in the history
Remove unneeded try/catches b/c the exception thrown in the event of a
failure will cause us to fail in the desired way.

Remove unstable() if PortaFiducia fails to download because we are
either pass/fail, and unstable() is a fail.

Signed-off-by: Seth Zegelstein <[email protected]>
(cherry picked from commit 17b7e9d)
  • Loading branch information
a-szegel committed Nov 5, 2024
1 parent 6d13765 commit 242b264
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions .ci/aws/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,11 @@ def download_and_extract_portafiducia(outputDir) {
/* Download PortaFiducia tarball from S3 and extract to outputDir */
def tempPath = "/tmp/portafiducia.tar.gz"
def downloadPath = this.get_portafiducia_download_path()

def ret = sh (
script: "mkdir -p ${outputDir} && aws s3 cp ${downloadPath} ${tempPath} && " +
"tar xf ${tempPath} -C ${outputDir}",
returnStatus: true,
)

if (ret != 0) {
unstable('Failed to download and extract PortaFiducia')
}
sh """
mkdir -p ${outputDir}
aws s3 cp ${downloadPath} ${tempPath}
tar xf ${tempPath} -C ${outputDir}
"""
}

def install_porta_fiducia() {
Expand Down Expand Up @@ -56,13 +51,8 @@ def run_test_orchestrator_once_persistent(run_name, build_tag, os, instance_type
def buildNumber = env.BUILD_NUMBER as int
def cluster_name = get_persistent_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}-PR${buildNumber}.xml"
sh ". venv/bin/activate; ./PortaFiducia/tests/test_orchestrator.py ${args}"

try {
sh ". venv/bin/activate; ./PortaFiducia/tests/test_orchestrator.py ${args}"
} catch (Exception e) {
currentBuild.result = "FAILURE"
throw e
}
}

def run_test_orchestrator_once_container(run_name, build_tag, os, container_os, instance_type, instance_count, region, odcr, addl_args) {
Expand All @@ -73,13 +63,8 @@ def run_test_orchestrator_once_container(run_name, build_tag, os, container_os,
def buildNumber = env.BUILD_NUMBER as int
def cluster_name = get_persistent_cluster_name(build_tag, os, instance_type)
def args = "--os ${os} --container-os ${container_os} --odcr ${odcr} --instance-type ${instance_type} --instance-count ${instance_count} --region ${region} --cluster-name ${cluster_name} ${addl_args} --junit-xml outputs/${cluster_name}-PR${buildNumber}-${os}-${container_os}.xml"
sh ". venv/bin/activate; ./PortaFiducia/tests/test_orchestrator.py ${args}"

try {
sh ". venv/bin/activate; ./PortaFiducia/tests/test_orchestrator.py ${args}"
} catch (Exception e) {
currentBuild.result = "FAILURE"
throw e
}
}

def get_test_stage_with_lock_persistent(stage_name, build_tag, os, instance_type, region, lock_label, lock_count, odcr, addl_args) {
Expand Down

0 comments on commit 242b264

Please sign in to comment.