diff --git a/buildenv/jenkins/JenkinsfileBase b/buildenv/jenkins/JenkinsfileBase index 1e1f238874..a2b95de7a0 100644 --- a/buildenv/jenkins/JenkinsfileBase +++ b/buildenv/jenkins/JenkinsfileBase @@ -423,11 +423,8 @@ def setup() { CODE_COVERAGE_OPTION = params.CODE_COVERAGE ? "--code_coverage true" : "" CURL_OPTS = (params.CURL_OPTS) ? "--curl_opts \"${params.CURL_OPTS}\"" : "" - - GET_SH_CMD = "./get.sh -s `pwd`/.. -p $PLATFORM -r ${SDK_RESOURCE} ${JDK_VERSION_OPTION} ${JDK_IMPL_OPTION} ${CUSTOMIZED_SDK_URL_OPTION} ${CLONE_OPENJ9_OPTION} ${OPENJ9_REPO_OPTION} ${OPENJ9_BRANCH_OPTION} ${OPENJ9_SHA_OPTION} ${TKG_REPO_OPTION} ${TKG_BRANCH_OPTION} ${VENDOR_TEST_REPOS} ${VENDOR_TEST_BRANCHES} ${VENDOR_TEST_DIRS} ${VENDOR_TEST_SHAS} ${TEST_IMAGES_REQUIRED} ${DEBUG_IMAGES_REQUIRED} ${CODE_COVERAGE_OPTION} ${CURL_OPTS}" RESOLVED_MAKE = "if [ `uname` = AIX ] || [ `uname` = SunOS ] || [ `uname` = *BSD ]; then MAKE=gmake; else MAKE=make; fi" - dir( WORKSPACE) { // use sshagent with Jenkins credentials ID for all platforms except zOS // on zOS use the user's ssh key @@ -441,6 +438,55 @@ def setup() { } } +def setup_jck_interactives() { + def targetDir = "${env.WORKSPACE}/../../jck_run/jdk${JDK_VERSION}/jdk" + if (PLATFORM.contains("windows")) { + targetDir = "c:/Users/jenkins/jck_run/jdk${JDK_VERSION}/jdk" + } + def tarBall = CUSTOMIZED_SDK_URL.tokenize('/').last() + echo "tarBall is ${tarBall}" + def jckRunDirExists = sh(script: """ + if [ -d "${targetDir}" ]; then + echo true + else + echo false + fi + """, returnStdout: true).toBoolean() + + if (jckRunDirExists) { + def jdkDir = "" + if (PLATFORM.contains("windows")) { + jdkDir = sh(script: "unzip -l `pwd`/openjdkbinary/${tarBall} | head -n 4 | tail -n 1 | xargs -n 1 echo | tail -n 1", returnStdout: true).trim().replaceFirst(".\$","") + if (PLATFORM.contains("x86-32_windows")) { + jdkDir = "${jdkDir}_32" + } else if (PLATFORM.contains("x86-64_windows")) { + jdkDir = "${jdkDir}_64" + } + } else { + jdkDir = sh(script: "tar -tf `pwd`/openjdkbinary/${tarBall} | head -1", returnStdout: true).trim().replaceFirst(".\$","") + } + def jckRunDir = "${targetDir}/${jdkDir}" + def jckRunJDKExists = sh(script: """ + if [ -d "${jckRunDir}" ]; then + echo true + else + echo false + fi + """, returnStdout: true).toBoolean() + + if (!jckRunJDKExists) { + sh returnStatus: true, script: """ + cd ${targetDir} + mkdir ${jdkDir} + cd ${jdkDir} + cp -r ${TEST_JDK_HOME}/* . + chgrp -R jck ${targetDir}/${jdkDir} + chmod -R 775 ${targetDir}/${jdkDir} + """ + } + } +} + def getJobProperties() { def jobProperties = "./aqa-tests/job.properties" if (fileExists("${jobProperties}")) { @@ -470,6 +516,9 @@ def get_sources() { sh "$GET_SH_CMD" } } + if (env.BUILD_LIST.contains('jck') && SDK_RESOURCE.contains('customized' && params.SETUP_JCK_RUN )) { + setup_jck_interactives() + } } def makeCompileTest(){ String makeTestCmd = "bash ./compile.sh ${USE_TESTENV_PROPERTIES}" diff --git a/buildenv/jenkins/aqaTestPipeline.groovy b/buildenv/jenkins/aqaTestPipeline.groovy index 2d2fa79f79..5e2101257c 100644 --- a/buildenv/jenkins/aqaTestPipeline.groovy +++ b/buildenv/jenkins/aqaTestPipeline.groovy @@ -15,6 +15,8 @@ def LABEL = (params.LABEL) ?: "" 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 + // Use BUILD_USER_ID if set and jdk-JDK_VERSIONS def DEFAULT_SUFFIX = (env.BUILD_USER_ID) ? "${env.BUILD_USER_ID} - jdk-${params.JDK_VERSIONS}" : "jdk-${params.JDK_VERSIONS}" @@ -116,7 +118,8 @@ JDK_VERSIONS.each { JDK_VERSION -> string(name: 'LABEL_ADDITION', value: LABEL_ADDITION), string(name: 'TEST_FLAG', value: TEST_FLAG), string(name: 'APPLICATION_OPTIONS', value: APPLICATION_OPTIONS), - booleanParam(name: 'KEEP_REPORTDIR', value: keep_reportdir) + 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}" diff --git a/buildenv/jenkins/testJobTemplate b/buildenv/jenkins/testJobTemplate index 57e2972ef5..b50d49c2c5 100644 --- a/buildenv/jenkins/testJobTemplate +++ b/buildenv/jenkins/testJobTemplate @@ -139,6 +139,7 @@ def OPENJ9_REPO = "https://github.com/eclipse-openj9/openj9.git" def ADOPTOPENJDK_REPO = "https://github.com/adoptium/aqa-tests.git" def ADOPTOPENJDK_BRANCH = "master" def USE_TESTENV_PROPERTIES = false +def SETUP_JCK_RUN = false // Jenkins does not support using Repository URL and Branch build parameters with lightweight checkout together // (See https://issues.jenkins.io/browse/JENKINS-48431) @@ -438,6 +439,7 @@ ARCH_OS_LIST.each { ARCH_OS -> booleanParam('PERSONAL_BUILD', false, "Is this a personal build?") booleanParam('USE_TESTENV_PROPERTIES', USE_TESTENV_PROPERTIES.toBoolean(), "use properties defined in the testenv.properties") stringParam('RERUN_ITERATIONS', RERUN_ITERATIONS, "Optional. Number of times to repeat execution of failed test target(s).") + booleanParam('SETUP_JCK_RUN', SETUP_JCK_RUN.toBoolean(), "setup jdk during release for jck interactive run") } cpsScm { scm {