Skip to content

Commit

Permalink
Support OPENJCEPLUS_GIT_REPO and OPENJCEPLUS_GIT_BRANCH in testenv.pr…
Browse files Browse the repository at this point in the history
…operties

- 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]>
  • Loading branch information
llxia committed May 7, 2024
1 parent 348e551 commit 584806b
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 37 deletions.
5 changes: 3 additions & 2 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -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;. ./aqa-tests/testenvSettings.sh $WORKSPACE/aqa-tests;cd ./aqa-tests/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"
Expand Down Expand Up @@ -611,7 +612,7 @@ def get_sources() {
}
}
def makeCompileTest(){
String makeTestCmd = "bash ./compile.sh ${USE_TESTENV_PROPERTIES}"
String makeTestCmd = "bash ./compile.sh $WORKSPACE/aqa-tests"
//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"
Expand Down
30 changes: 1 addition & 29 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./testenvSettings.sh $1

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
43 changes: 41 additions & 2 deletions functional/OpenJcePlusTests/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,47 @@
</if>

<target name="getOpenJcePlusTests" depends="openJcePlusTests.check" unless="openJcePlusTests.exists">
<getFileWithRetry file="OpenJCEPlus" command="git clone --depth 1 -q ${openjceplusGitRepo} -b ${openjceplusGitBranch} OpenJCEPlus"/>
<checkGitRepoSha repoDir="OpenJCEPlus"/>
<getFileWithRetry file="OpenJCEPlus" command="git clone -q ${openjceplusGitRepo} OpenJCEPlus"/>
<echo message="git rev-parse ${openjceplusGitBranch} "/>
<exec executable="git" failonerror="false" dir="OpenJCEPlus" outputproperty="repo_sha1" resultproperty="code">
<arg value="rev-parse"/>
<arg value="${openjceplusGitBranch}"/>
</exec>
<if>
<equals arg1="${code}" arg2="128"/>
<then>
<echo message="git rev-parse origin/${openjceplusGitBranch}"/>
<exec executable="git" failonerror="true" dir="OpenJCEPlus" outputproperty="repo_sha2" resultproperty="code2">
<arg value="rev-parse"/>
<arg value="origin/${openjceplusGitBranch}"/>
</exec>
<property name="repo_sha" value="${repo_sha2}"/>
</then>
</if>
<if>
<not>
<isset property="repo_sha"/>
</not>
<then>
<property name="repo_sha" value="${repo_sha1}"/>
</then>
</if>
<if>
<isset property="isZOS"/>
<then>
<propertyregex property="repo_sha" input="${repo_sha}" regexp="\n" replace="" override="true"/>
</then>
</if>
<echo message="git checkout -q -f ${repo_sha} "/>
<exec executable="git" failonerror="true" dir="OpenJCEPlus">
<arg value="checkout"/>
<arg value="-q"/>
<arg value="-f"/>
<arg value="${repo_sha}"/>
</exec>
<checkGitRepoSha repoDir="OpenJCEPlus" />
<addTestenvProperties repoDir="OpenJCEPlus" repoName="OpenJCEPlus"/>

<delete dir="./OpenJCEPlus/src/main" />
</target>

Expand Down
18 changes: 14 additions & 4 deletions testenv/testenv.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
TKG_REPO=https://github.com/adoptium/TKG.git
TKG_BRANCH=master
OPENJ9_REPO=https://github.com/eclipse-openj9/openj9.git
OPENJ9_BRANCH=master
OPENJ9_BRANCH=v0.44.0-release
STF_REPO=https://github.com/adoptium/STF.git
STF_BRANCH=master
STF_BRANCH=v1.0.1
OPENJ9_SYSTEMTEST_REPO=https://github.com/eclipse-openj9/openj9-systemtest.git
OPENJ9_SYSTEMTEST_BRANCH=master
OPENJ9_SYSTEMTEST_BRANCH=openj9-0.41.0
ADOPTOPENJDK_SYSTEMTEST_REPO=https://github.com/adoptium/aqa-systemtest.git
ADOPTOPENJDK_SYSTEMTEST_BRANCH=master
ADOPTOPENJDK_SYSTEMTEST_BRANCH=v1.0.1.1
JDK8_REPO=https://github.com/adoptium/jdk8u.git
JDK8_BRANCH=dev
JDK11_REPO=https://github.com/adoptium/jdk11u.git
Expand All @@ -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=1afb341176257c109b65b4151159e0838d1e2fbe
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
49 changes: 49 additions & 0 deletions testenvSettings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
set +x

path=$1
echo path=$path
if [[ $USE_TESTENV_PROPERTIES == true ]]; then
testenv_file="${path}/testenv/testenv.properties"
if [[ "$PLATFORM" == *"zos"* ]]; then
testenv_file="${path}/testenv/testenv_zos.properties"
fi
if [[ "$PLATFORM" == *"arm"* ]] && [[ "$JDK_VERSION" == "8" ]]; then
testenv_file="${path}/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

0 comments on commit 584806b

Please sign in to comment.