From 3323c240ae2ab42496ca337893d6561dbfa97c9a Mon Sep 17 00:00:00 2001 From: Lan Xia Date: Mon, 6 May 2024 19:50:38 -0400 Subject: [PATCH] Support OPENJCEPLUS_GIT_REPO and OPENJCEPLUS_GIT_BRANCH in testenv.properties - create testenvSettings.sh for testenv variable settings - export OPENJCEPLUS_GIT_REPO and OPENJCEPLUS_GIT_BRANCH values in testenvSettings.sh - update functional/OpenJcePlusTests/build.xml to handle branch/tag/sha values - add JDKXXX_OPENJCEPLUS_GIT_REPO and JDKXXX_OPENJCEPLUS_GIT_BRANCH in testenv.properties - when DYNAMIC_COMPILE=true, we will run make test command directly (compile.sh will be skipped) To fix https://github.com/adoptium/aqa-tests/issues/4509, testenvSettings.sh needs to run before make test command resolves: https://github.com/adoptium/aqa-tests/issues/5290 and https://github.com/adoptium/aqa-tests/issues/4509 Signed-off-by: Lan Xia --- buildenv/jenkins/JenkinsfileBase | 5 +-- compile.sh | 30 +---------------- functional/OpenJcePlusTests/build.xml | 43 ++++++++++++++++++++++-- scripts/testenv/testenvSettings.sh | 48 +++++++++++++++++++++++++++ testenv/testenv.properties | 10 ++++++ 5 files changed, 103 insertions(+), 33 deletions(-) create mode 100755 scripts/testenv/testenvSettings.sh diff --git a/buildenv/jenkins/JenkinsfileBase b/buildenv/jenkins/JenkinsfileBase index f33a0e9d6a..b6e7d59e1a 100644 --- a/buildenv/jenkins/JenkinsfileBase +++ b/buildenv/jenkins/JenkinsfileBase @@ -5,7 +5,8 @@ import org.tap4j.model.TestSet; def makeTest(testParam) { String tearDownCmd = "$RESOLVED_MAKE; \$MAKE -f ./aqa-tests/TKG/testEnv.mk testEnvTeardown" - String makeTestCmd = "$RESOLVED_MAKE; cd ./aqa-tests/TKG; \$MAKE $testParam" + // Note: keyword source cannot be used in Jenkins script. Therefore, using "." instead. + String makeTestCmd = "$RESOLVED_MAKE;cd ./aqa-tests; . ./scripts/testenv/testenvSettings.sh;cd ./TKG; \$MAKE $testParam" //unset LD_LIBRARY_PATH workaround for issue https://github.com/adoptium/infrastructure/issues/2934 if (JDK_IMPL == 'hotspot' && JDK_VERSION == '8' && PLATFORM.contains('alpine-linux')) { makeTestCmd = "unset LD_LIBRARY_PATH; $makeTestCmd" @@ -611,7 +612,7 @@ def get_sources() { } } def makeCompileTest(){ - String makeTestCmd = "bash ./compile.sh ${USE_TESTENV_PROPERTIES}" + String makeTestCmd = "bash ./compile.sh" //unset LD_LIBRARY_PATH workaround for issue https://github.com/adoptium/infrastructure/issues/2934 if (JDK_IMPL == 'hotspot' && JDK_VERSION == '8' && PLATFORM.contains('alpine-linux')) { makeTestCmd = "unset LD_LIBRARY_PATH; $makeTestCmd" diff --git a/compile.sh b/compile.sh index d6737c3e11..d760061926 100755 --- a/compile.sh +++ b/compile.sh @@ -8,36 +8,8 @@ if [ $(uname) = AIX ] || [ $(uname) = SunOS ] || [ $(uname) = *BSD ]; then else MAKE=make fi -if [ $USE_TESTENV_PROPERTIES == true ]; then - testenv_file="./testenv/testenv.properties" - if [[ "$PLATFORM" == *"zos"* ]]; then - testenv_file="./testenv/testenv_zos.properties" - fi - if [[ "$PLATFORM" == *"arm"* ]] && [[ "$JDK_VERSION" == "8" ]]; then - testenv_file="./testenv/testenv_arm32.properties" - fi - while read line; do - export $line - done <$testenv_file - if [ $JDK_IMPL == "openj9" ] || [ $JDK_IMPL == "ibm" ]; then - repo=JDK${JDK_VERSION}_OPENJ9_REPO - branch=JDK${JDK_VERSION}_OPENJ9_BRANCH - else - repo=JDK${JDK_VERSION}_REPO - branch=JDK${JDK_VERSION}_BRANCH - fi - eval repo2='$'$repo - eval branch2='$'$branch +source ./scripts/testenv/testenvSettings.sh - export JDK_REPO=$repo2 - export JDK_BRANCH=$branch2 - echo "Set values based on ${testenv_file}:" - cat $testenv_file - echo "" - echo "JDK_REPO=${JDK_REPO}" - echo "JDK_BRANCH=${JDK_BRANCH}" - -fi cd ./TKG $MAKE compile diff --git a/functional/OpenJcePlusTests/build.xml b/functional/OpenJcePlusTests/build.xml index bff4b9a848..cfd7eeee74 100644 --- a/functional/OpenJcePlusTests/build.xml +++ b/functional/OpenJcePlusTests/build.xml @@ -56,8 +56,47 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/testenv/testenvSettings.sh b/scripts/testenv/testenvSettings.sh new file mode 100755 index 0000000000..7d67348487 --- /dev/null +++ b/scripts/testenv/testenvSettings.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set +x +set -eo pipefail + +if [[ $USE_TESTENV_PROPERTIES == true ]]; then + testenv_file="./testenv/testenv.properties" + if [[ "$PLATFORM" == *"zos"* ]]; then + testenv_file="./testenv/testenv_zos.properties" + fi + if [[ "$PLATFORM" == *"arm"* ]] && [[ "$JDK_VERSION" == "8" ]]; then + testenv_file="./testenv/testenv_arm32.properties" + fi + while read line; do + export $line + done <$testenv_file + if [[ $JDK_IMPL == "openj9" ]] || [[ $JDK_IMPL == "ibm" ]]; then + repo=JDK${JDK_VERSION}_OPENJ9_REPO + branch=JDK${JDK_VERSION}_OPENJ9_BRANCH + + openjceplus_repo=JDK${JDK_VERSION}_OPENJCEPLUS_GIT_REPO + openjceplus_branch=JDK${JDK_VERSION}_OPENJCEPLUS_GIT_BRANCH + eval openjceplus_repo2='$'$openjceplus_repo + eval openjceplus_branch2='$'$openjceplus_branch + export OPENJCEPLUS_GIT_REPO=$openjceplus_repo2 + export OPENJCEPLUS_GIT_BRANCH=$openjceplus_branch2 + + else + repo=JDK${JDK_VERSION}_REPO + branch=JDK${JDK_VERSION}_BRANCH + fi + + eval repo2='$'$repo + eval branch2='$'$branch + + export JDK_REPO=$repo2 + export JDK_BRANCH=$branch2 + echo "Set values based on ${testenv_file}:" + echo "=========" + cat $testenv_file + echo "" + echo "=========" + echo "" + echo "JDK_REPO=${JDK_REPO}" + echo "JDK_BRANCH=${JDK_BRANCH}" + echo "OPENJCEPLUS_GIT_REPO=${OPENJCEPLUS_GIT_REPO}" + echo "OPENJCEPLUS_GIT_BRANCH=${OPENJCEPLUS_GIT_BRANCH}" + +fi diff --git a/testenv/testenv.properties b/testenv/testenv.properties index 10056e176d..b69bed51ab 100644 --- a/testenv/testenv.properties +++ b/testenv/testenv.properties @@ -24,4 +24,14 @@ JDK17_OPENJ9_REPO=https://github.com/ibmruntimes/openj9-openjdk-jdk17.git JDK17_OPENJ9_BRANCH=openj9 JDK21_OPENJ9_REPO=https://github.com/ibmruntimes/openj9-openjdk-jdk21.git JDK21_OPENJ9_BRANCH=openj9 +JDK8_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git +JDK8_OPENJCEPLUS_GIT_BRANCH=semeru-java8 +JDK11_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git +JDK11_OPENJCEPLUS_GIT_BRANCH=semeru-java11 +JDK17_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git +JDK17_OPENJCEPLUS_GIT_BRANCH=semeru-java17 +JDK21_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git +JDK21_OPENJCEPLUS_GIT_BRANCH=semeru-java21 +JDK22_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git +JDK22_OPENJCEPLUS_GIT_BRANCH=semeru-java22 AQA_REQUIRED_TARGETS=sanity.functional,extended.functional,special.functional,sanity.openjdk,extended.openjdk,sanity.system,extended.system,sanity.perf,extended.perf \ No newline at end of file