Skip to content

Commit

Permalink
Aggregate Downstream test results in AQA test pipeline (#4733)
Browse files Browse the repository at this point in the history
- also allow user to set LIGHT_WEIGHT_CHECKOUT value

resolves: #4729

Signed-off-by: Lan Xia <Lan_Xia@ca.ibm.com>
  • Loading branch information
llxia committed Aug 29, 2023
1 parent e315fa3 commit 6af52fd
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions buildenv/jenkins/aqaTestPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def LABEL_ADDITION = (params.LABEL_ADDITION) ?: ""
def TEST_FLAG = (params.TEST_FLAG) ?: ""
def APPLICATION_OPTIONS = (params.APPLICATION_OPTIONS) ?: ""
def SETUP_JCK_RUN = params.SETUP_JCK_RUN ?: false
def LIGHT_WEIGHT_CHECKOUT = params.LIGHT_WEIGHT_CHECKOUT ?: false


// Use BUILD_USER_ID if set and jdk-JDK_VERSIONS
Expand All @@ -31,6 +32,8 @@ def suffix = ""
if (TEST_FLAG) {
suffix = "_" + TEST_FLAG.toLowerCase().trim()
}

def fail = false
JDK_VERSIONS.each { JDK_VERSION ->
PLATFORMS.each { PLATFORM ->
String[] tokens = PLATFORM.split('_')
Expand Down Expand Up @@ -94,7 +97,7 @@ JDK_VERSIONS.each { JDK_VERSION ->
string(name: 'JDK_VERSIONS', value: JDK_VERSION),
string(name: 'ARCH_OS_LIST', value: PLATFORM),
string(name: 'JDK_IMPL', value: jdk_impl),
booleanParam(name: 'LIGHT_WEIGHT_CHECKOUT', value: false)
booleanParam(name: 'LIGHT_WEIGHT_CHECKOUT', value: LIGHT_WEIGHT_CHECKOUT)
]
build job: 'Test_Job_Auto_Gen', parameters: parameters, propagate: true
}
Expand All @@ -112,7 +115,7 @@ JDK_VERSIONS.each { JDK_VERSION ->
string(name: 'PARALLEL', value: PARALLEL),
string(name: 'NUM_MACHINES', value: NUM_MACHINES.toString()),
booleanParam(name: 'GENERATE_JOBS', value: AUTO_AQA_GEN),
booleanParam(name: 'LIGHT_WEIGHT_CHECKOUT', value: false),
booleanParam(name: 'LIGHT_WEIGHT_CHECKOUT', value: LIGHT_WEIGHT_CHECKOUT),
string(name: 'TIME_LIMIT', value: TIME_LIMIT.toString()),
string(name: 'TRSS_URL', value: TRSS_URL),
string(name: 'LABEL', value: LABEL),
Expand All @@ -122,8 +125,8 @@ JDK_VERSIONS.each { JDK_VERSION ->
booleanParam(name: 'KEEP_REPORTDIR', value: keep_reportdir),
booleanParam(name: 'SETUP_JCK_RUN', value: SETUP_JCK_RUN)
], wait: true
def result = downstreamJob.getResult()
echo " ${TEST_JOB_NAME} result is ${result}"
def downstreamJobResult = downstreamJob.getResult()
echo " ${TEST_JOB_NAME} result is ${downstreamJobResult}"
if (downstreamJob.getResult() == 'SUCCESS' || downstreamJob.getResult() == 'UNSTABLE') {
echo "[NODE SHIFT] MOVING INTO CONTROLLER NODE..."
node("worker || (ci.role.test&&hw.arch.x86&&sw.os.linux)") {
Expand All @@ -139,19 +142,21 @@ JDK_VERSIONS.each { JDK_VERSION ->
)
}
} catch (Exception e) {
echo 'Exception: ' + e.toString()
echo "Cannot run copyArtifacts from job ${TEST_JOB_NAME}. Skipping copyArtifacts..."
}
try {
timeout(time: 1, unit: 'HOURS') {
archiveArtifacts artifacts: "*.tap", fingerprint: true
}
} catch (Exception e) {
echo 'Exception: ' + e.toString()
echo "Cannot archiveArtifacts from job ${TEST_JOB_NAME}. "
}
}
} else {
echo " ${TEST_JOB_NAME} result is ${result}"
currentBuild.result = "FAILURE"
}
if (downstreamJobResult != "SUCCESS") {
fail = true
}
}
} else {
Expand All @@ -161,3 +166,7 @@ JDK_VERSIONS.each { JDK_VERSION ->
}
}
parallel JOBS
if (fail) {
currentBuild.result = "FAILURE"
}

0 comments on commit 6af52fd

Please sign in to comment.