Skip to content

Commit 8f4eea5

Browse files
authored
Support OPENJCEPLUS_GIT_REPO and OPENJCEPLUS_GIT_BRANCH in testenv.properties (#5291)
- 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 #4509, testenvSettings.sh needs to run before make test command resolves: #5290 and #4509 Signed-off-by: Lan Xia <[email protected]>
1 parent b2a0d5a commit 8f4eea5

File tree

5 files changed

+103
-33
lines changed

5 files changed

+103
-33
lines changed

buildenv/jenkins/JenkinsfileBase

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import org.tap4j.model.TestSet;
55

66
def makeTest(testParam) {
77
String tearDownCmd = "$RESOLVED_MAKE; \$MAKE -f ./aqa-tests/TKG/testEnv.mk testEnvTeardown"
8-
String makeTestCmd = "$RESOLVED_MAKE; cd ./aqa-tests/TKG; \$MAKE $testParam"
8+
// Note: keyword source cannot be used in Jenkins script. Therefore, using "." instead.
9+
String makeTestCmd = "$RESOLVED_MAKE;cd ./aqa-tests; . ./scripts/testenv/testenvSettings.sh;cd ./TKG; \$MAKE $testParam"
910
//unset LD_LIBRARY_PATH workaround for issue https://github.com/adoptium/infrastructure/issues/2934
1011
if (JDK_IMPL == 'hotspot' && JDK_VERSION == '8' && PLATFORM.contains('alpine-linux')) {
1112
makeTestCmd = "unset LD_LIBRARY_PATH; $makeTestCmd"
@@ -611,7 +612,7 @@ def get_sources() {
611612
}
612613
}
613614
def makeCompileTest(){
614-
String makeTestCmd = "bash ./compile.sh ${USE_TESTENV_PROPERTIES}"
615+
String makeTestCmd = "bash ./compile.sh"
615616
//unset LD_LIBRARY_PATH workaround for issue https://github.com/adoptium/infrastructure/issues/2934
616617
if (JDK_IMPL == 'hotspot' && JDK_VERSION == '8' && PLATFORM.contains('alpine-linux')) {
617618
makeTestCmd = "unset LD_LIBRARY_PATH; $makeTestCmd"

compile.sh

+1-29
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,8 @@ if [ $(uname) = AIX ] || [ $(uname) = SunOS ] || [ $(uname) = *BSD ]; then
88
else
99
MAKE=make
1010
fi
11-
if [ $USE_TESTENV_PROPERTIES == true ]; then
12-
testenv_file="./testenv/testenv.properties"
13-
if [[ "$PLATFORM" == *"zos"* ]]; then
14-
testenv_file="./testenv/testenv_zos.properties"
15-
fi
16-
if [[ "$PLATFORM" == *"arm"* ]] && [[ "$JDK_VERSION" == "8" ]]; then
17-
testenv_file="./testenv/testenv_arm32.properties"
18-
fi
19-
while read line; do
20-
export $line
21-
done <$testenv_file
22-
if [ $JDK_IMPL == "openj9" ] || [ $JDK_IMPL == "ibm" ]; then
23-
repo=JDK${JDK_VERSION}_OPENJ9_REPO
24-
branch=JDK${JDK_VERSION}_OPENJ9_BRANCH
25-
else
26-
repo=JDK${JDK_VERSION}_REPO
27-
branch=JDK${JDK_VERSION}_BRANCH
28-
fi
2911

30-
eval repo2='$'$repo
31-
eval branch2='$'$branch
12+
source ./scripts/testenv/testenvSettings.sh
3213

33-
export JDK_REPO=$repo2
34-
export JDK_BRANCH=$branch2
35-
echo "Set values based on ${testenv_file}:"
36-
cat $testenv_file
37-
echo ""
38-
echo "JDK_REPO=${JDK_REPO}"
39-
echo "JDK_BRANCH=${JDK_BRANCH}"
40-
41-
fi
4214
cd ./TKG
4315
$MAKE compile

functional/OpenJcePlusTests/build.xml

+41-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,47 @@
5656
</if>
5757

5858
<target name="getOpenJcePlusTests" depends="openJcePlusTests.check" unless="openJcePlusTests.exists">
59-
<getFileWithRetry file="OpenJCEPlus" command="git clone --depth 1 -q ${openjceplusGitRepo} -b ${openjceplusGitBranch} OpenJCEPlus"/>
60-
<checkGitRepoSha repoDir="OpenJCEPlus"/>
59+
<getFileWithRetry file="OpenJCEPlus" command="git clone -q ${openjceplusGitRepo} OpenJCEPlus"/>
60+
<echo message="git rev-parse ${openjceplusGitBranch} "/>
61+
<exec executable="git" failonerror="false" dir="OpenJCEPlus" outputproperty="repo_sha1" resultproperty="code">
62+
<arg value="rev-parse"/>
63+
<arg value="${openjceplusGitBranch}"/>
64+
</exec>
65+
<if>
66+
<equals arg1="${code}" arg2="128"/>
67+
<then>
68+
<echo message="git rev-parse origin/${openjceplusGitBranch}"/>
69+
<exec executable="git" failonerror="true" dir="OpenJCEPlus" outputproperty="repo_sha2" resultproperty="code2">
70+
<arg value="rev-parse"/>
71+
<arg value="origin/${openjceplusGitBranch}"/>
72+
</exec>
73+
<property name="repo_sha" value="${repo_sha2}"/>
74+
</then>
75+
</if>
76+
<if>
77+
<not>
78+
<isset property="repo_sha"/>
79+
</not>
80+
<then>
81+
<property name="repo_sha" value="${repo_sha1}"/>
82+
</then>
83+
</if>
84+
<if>
85+
<isset property="isZOS"/>
86+
<then>
87+
<propertyregex property="repo_sha" input="${repo_sha}" regexp="\n" replace="" override="true"/>
88+
</then>
89+
</if>
90+
<echo message="git checkout -q -f ${repo_sha} "/>
91+
<exec executable="git" failonerror="true" dir="OpenJCEPlus">
92+
<arg value="checkout"/>
93+
<arg value="-q"/>
94+
<arg value="-f"/>
95+
<arg value="${repo_sha}"/>
96+
</exec>
97+
<checkGitRepoSha repoDir="OpenJCEPlus" />
98+
<addTestenvProperties repoDir="OpenJCEPlus" repoName="OpenJCEPlus"/>
99+
61100
<delete dir="./OpenJCEPlus/src/main" />
62101
</target>
63102

scripts/testenv/testenvSettings.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
set +x
3+
set -eo pipefail
4+
5+
if [[ $USE_TESTENV_PROPERTIES == true ]]; then
6+
testenv_file="./testenv/testenv.properties"
7+
if [[ "$PLATFORM" == *"zos"* ]]; then
8+
testenv_file="./testenv/testenv_zos.properties"
9+
fi
10+
if [[ "$PLATFORM" == *"arm"* ]] && [[ "$JDK_VERSION" == "8" ]]; then
11+
testenv_file="./testenv/testenv_arm32.properties"
12+
fi
13+
while read line; do
14+
export $line
15+
done <$testenv_file
16+
if [[ $JDK_IMPL == "openj9" ]] || [[ $JDK_IMPL == "ibm" ]]; then
17+
repo=JDK${JDK_VERSION}_OPENJ9_REPO
18+
branch=JDK${JDK_VERSION}_OPENJ9_BRANCH
19+
20+
openjceplus_repo=JDK${JDK_VERSION}_OPENJCEPLUS_GIT_REPO
21+
openjceplus_branch=JDK${JDK_VERSION}_OPENJCEPLUS_GIT_BRANCH
22+
eval openjceplus_repo2='$'$openjceplus_repo
23+
eval openjceplus_branch2='$'$openjceplus_branch
24+
export OPENJCEPLUS_GIT_REPO=$openjceplus_repo2
25+
export OPENJCEPLUS_GIT_BRANCH=$openjceplus_branch2
26+
27+
else
28+
repo=JDK${JDK_VERSION}_REPO
29+
branch=JDK${JDK_VERSION}_BRANCH
30+
fi
31+
32+
eval repo2='$'$repo
33+
eval branch2='$'$branch
34+
35+
export JDK_REPO=$repo2
36+
export JDK_BRANCH=$branch2
37+
echo "Set values based on ${testenv_file}:"
38+
echo "========="
39+
cat $testenv_file
40+
echo ""
41+
echo "========="
42+
echo ""
43+
echo "JDK_REPO=${JDK_REPO}"
44+
echo "JDK_BRANCH=${JDK_BRANCH}"
45+
echo "OPENJCEPLUS_GIT_REPO=${OPENJCEPLUS_GIT_REPO}"
46+
echo "OPENJCEPLUS_GIT_BRANCH=${OPENJCEPLUS_GIT_BRANCH}"
47+
48+
fi

testenv/testenv.properties

+10
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,14 @@ JDK17_OPENJ9_REPO=https://github.com/ibmruntimes/openj9-openjdk-jdk17.git
2424
JDK17_OPENJ9_BRANCH=openj9
2525
JDK21_OPENJ9_REPO=https://github.com/ibmruntimes/openj9-openjdk-jdk21.git
2626
JDK21_OPENJ9_BRANCH=openj9
27+
JDK8_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git
28+
JDK8_OPENJCEPLUS_GIT_BRANCH=semeru-java8
29+
JDK11_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git
30+
JDK11_OPENJCEPLUS_GIT_BRANCH=semeru-java11
31+
JDK17_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git
32+
JDK17_OPENJCEPLUS_GIT_BRANCH=semeru-java17
33+
JDK21_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git
34+
JDK21_OPENJCEPLUS_GIT_BRANCH=semeru-java21
35+
JDK22_OPENJCEPLUS_GIT_REPO=https://github.com/ibmruntimes/OpenJCEPlus.git
36+
JDK22_OPENJCEPLUS_GIT_BRANCH=semeru-java22
2737
AQA_REQUIRED_TARGETS=sanity.functional,extended.functional,special.functional,sanity.openjdk,extended.openjdk,sanity.system,extended.system,sanity.perf,extended.perf

0 commit comments

Comments
 (0)