Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check remote JCK job asynchronously and set stage status correspondingly #1189

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 53 additions & 36 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ class Build {
def sdkUrl = "${env.BUILD_URL}/artifact/workspace/target/${jdkFileName}"
context.echo "sdkUrl is ${sdkUrl}"
def remoteTargets = [:]
def remoteTriggeredBuilds = [:]
def additionalTestLabel = buildConfig.ADDITIONAL_TEST_LABEL
def aqaAutoGen = buildConfig.AQA_AUTO_GEN ?: false
def setupJCKRun = false
Expand Down Expand Up @@ -621,17 +622,17 @@ class Build {

targets.each { targetMode, targetTests ->
try {
context.println "Remote trigger: ${targetTests}"
remoteTargets["${targetTests}"] = {
context.println "Remote trigger: ${targetTests}"
def displayName = "jdk${jdkVersion} : ${buildConfig.SCM_REF} : ${platform} : ${targetTests}"
def parallel = 'None'
def num_machines = '1'
if ("${targetMode}" == 'parallel') {
parallel = 'Dynamic'
num_machines = '2'
parallel = 'Dynamic'
num_machines = '2'
}
context.catchError {
context.triggerRemoteJob abortTriggeredJob: true,
remoteTriggeredBuilds["${targetTests}"] = context.triggerRemoteJob abortTriggeredJob: true,
blockBuildUntilComplete: false,
job: 'AQA_Test_Pipeline',
parameters: context.MapParameters(parameters: [context.MapParameter(name: 'SDK_RESOURCE', value: 'customized'),
Expand Down Expand Up @@ -661,8 +662,8 @@ class Build {
context.println "Failed to remote trigger jck tests: ${e.message}"
}
}

return remoteTargets
context.parallel remoteTargets
return remoteTriggeredBuilds
}

def compareReproducibleBuild(String nonDockerNodeName) {
Expand Down Expand Up @@ -2508,41 +2509,57 @@ def buildScriptsAssemble(

// Run Smoke Tests and AQA Tests
if (enableTests) {
if (currentBuild.currentResult != "SUCCESS") {
context.println('[ERROR] Build stages were not successful, not running AQA tests')
} else {
try {
//Only smoke tests succeed TCK and AQA tests will be triggerred.
context.println "openjdk_build_pipeline: running smoke tests"
if (runSmokeTests() == 'SUCCESS') {
context.println "openjdk_build_pipeline: smoke tests OK - running full AQA suite"
// Remote trigger Eclipse Temurin JCK tests
if (buildConfig.VARIANT == 'temurin' && enableTCK) {
def platform = ''
if (buildConfig.ARCHITECTURE.contains('x64')) {
platform = 'x86-64_' + buildConfig.TARGET_OS
} else {
platform = buildConfig.ARCHITECTURE + '_' + buildConfig.TARGET_OS
}
if ( !(buildConfig.JAVA_TO_BUILD == 'jdk8u' && platform == 's390x_linux') ) {
context.echo "openjdk_build_pipeline: Remote trigger Eclipse Temurin AQA_Test_Pipeline job with ${platform} ${buildConfig.JAVA_TO_BUILD}"
def remoteTargets = remoteTriggerJckTests(platform, filename)
context.parallel remoteTargets
if (currentBuild.currentResult != "SUCCESS") {
context.println('[ERROR] Build stages were not successful, not running AQA tests')
} else {
try {
//Only smoke tests succeed TCK and AQA tests will be triggerred.
context.println "openjdk_build_pipeline: running smoke tests"
if (runSmokeTests() == 'SUCCESS') {
context.println "openjdk_build_pipeline: smoke tests OK - running full AQA suite"
// Remote trigger Eclipse Temurin JCK tests
def remoteTriggeredBuilds = [:]
if (buildConfig.VARIANT == 'temurin' && enableTCK) {
def platform = ''
if (buildConfig.ARCHITECTURE.contains('x64')) {
platform = 'x86-64_' + buildConfig.TARGET_OS
} else {
platform = buildConfig.ARCHITECTURE + '_' + buildConfig.TARGET_OS
}
if ( !(buildConfig.JAVA_TO_BUILD == 'jdk8u' && platform == 's390x_linux') ) {
context.echo "openjdk_build_pipeline: Remote trigger Eclipse Temurin AQA_Test_Pipeline job with ${platform} ${buildConfig.JAVA_TO_BUILD}"
//def remoteTargets = remoteTriggerJckTests(platform, filename)
//context.parallel remoteTargets
remoteTriggeredBuilds = remoteTriggerJckTests(platform, filename)
}
}
}

if (buildConfig.TEST_LIST.size() > 0) {
def testStages = runAQATests()
context.parallel testStages
if (buildConfig.TEST_LIST.size() > 0) {
def testStages = runAQATests()
context.parallel testStages
}

// Asynchronously get the remote JCK job status and set as the stage status.
if (buildConfig.VARIANT == 'temurin' && enableTCK && remoteTriggeredBuilds.asBoolean()) {
remoteTriggeredBuilds.each{ testTargets, jobHandle ->
context.stage("${testTargets}") {
while( !jobHandle.isFinished() ) {
context.println "Current ${testTargets} Status: " + jobHandle.getBuildStatus().toString();
sleep 3600
jobHandle.updateBuildStatus()
}
setStageResult("${testTargets}", jobHandle.getBuildResult().toString());
}
}
}
} else {
context.println('[ERROR]Smoke tests are not successful! AQA and Tck tests are blocked ')
}
} else {
context.println('[ERROR]Smoke tests are not successful! AQA and Tck tests are blocked ')
} catch (Exception e) {
context.println(e.message)
currentBuild.result = 'FAILURE'
}
} catch (Exception e) {
context.println(e.message)
currentBuild.result = 'FAILURE'
}
}
}

// Compare reproducible build if needed
Expand Down