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

consume property in openjdk build.xml #3039

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
2c6401e
ignore params if set read property
xius666 Oct 6, 2021
d7555ad
change
xius666 Oct 6, 2021
81e45e9
wrap the option into if
xius666 Oct 6, 2021
622cfda
wrap the get_sh_cmd in if
xius666 Oct 6, 2021
a0d69cf
add a printing in get.sh
xius666 Oct 6, 2021
befdf28
delete printing in get.sh
xius666 Oct 6, 2021
952a839
made change
xius666 Oct 7, 2021
7e6244f
made change
xius666 Oct 7, 2021
0e03d8d
made change
xius666 Oct 7, 2021
b07bf71
add complie.sh
xius666 Oct 7, 2021
15fc25f
export env
xius666 Oct 7, 2021
50bb754
add a direcotry
xius666 Oct 7, 2021
f157cf5
add a bash for the cmd
xius666 Oct 7, 2021
d1a95ab
change
xius666 Oct 7, 2021
e1de1e1
delete make
xius666 Oct 7, 2021
035c381
change typo
xius666 Oct 9, 2021
a31eeb7
Merge branch 'master' of https://github.com/adoptium/aqa-tests into i…
xius666 Oct 14, 2021
043040e
change
xius666 Oct 15, 2021
4a6c998
test invalid
xius666 Oct 15, 2021
e68cfeb
tkgrepo=empty
xius666 Oct 17, 2021
bf97cc2
tkgrepo=empty fix
xius666 Oct 17, 2021
3bfc8e0
tkgbranch=invalid
xius666 Oct 17, 2021
57fd129
tkgbranch=myown
xius666 Oct 17, 2021
4f26165
tkgbranch=sha
xius666 Oct 17, 2021
a1c9285
openj9repo=myown
xius666 Oct 17, 2021
6cc9840
default
xius666 Oct 17, 2021
14508e4
tkgrepo=invaid
xius666 Oct 17, 2021
ae5e2f4
back to default
xius666 Oct 17, 2021
a402927
initial version
xius666 Oct 17, 2021
7c98341
initial version
xius666 Oct 17, 2021
c547ec1
fix bug
xius666 Oct 17, 2021
0605176
fix close tag
xius666 Oct 17, 2021
62bf322
fix close tag
xius666 Oct 17, 2021
ca3d6d3
Merge pull request #1 from xius666/issue2918
xius666 Oct 17, 2021
5570c2a
fix bug
xius666 Oct 17, 2021
e396757
fix bug
xius666 Oct 17, 2021
e9a9a64
fix bug
xius666 Oct 17, 2021
70c2a6d
fix bug
xius666 Oct 18, 2021
be8e3ee
test
xius666 Oct 18, 2021
ca8decd
test
xius666 Oct 18, 2021
d0feab6
test
xius666 Oct 18, 2021
30c79a8
test
xius666 Oct 18, 2021
2aae9d2
test
xius666 Oct 18, 2021
e2bf927
fix export
xius666 Oct 18, 2021
472763f
fix dir
xius666 Oct 18, 2021
f9afc20
fix make
xius666 Oct 18, 2021
de9b76f
fix make
xius666 Oct 18, 2021
2bd368f
fix
xius666 Oct 19, 2021
996c7b0
finish
xius666 Oct 19, 2021
e4952c8
Merge branch 'issue2918' of https://github.com/xius666/aqa-tests into…
xius666 Oct 19, 2021
e563a55
merge
xius666 Oct 19, 2021
f215fbe
remove echo
xius666 Oct 20, 2021
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
76 changes: 49 additions & 27 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@ def setupEnv() {
if ( params.JDK_VERSION ) {
env.ORIGIN_JDK_VERSION = params.JDK_VERSION
env.JDK_VERSION = params.JDK_VERSION.equalsIgnoreCase("next") ? "" : params.JDK_VERSION
}
}
env.USE_TESTENV_PROPERTIES = params.USE_TESTENV_PROPERTIES

env.SPEC = "${SPEC}"

ADOPTOPENJDK_REPO = params.ADOPTOPENJDK_REPO ? params.ADOPTOPENJDK_REPO : "https://github.com/adoptium/aqa-tests.git"
OPENJ9_REPO = params.OPENJ9_REPO ? params.OPENJ9_REPO : "https://github.com/eclipse-openj9/openj9.git"

String[] tkg = getGitRepoBranch(params.TKG_OWNER_BRANCH, "adoptium:master", "TKG")
TKG_REPO = tkg[0]
TKG_BRANCH = tkg[1]

//For Zos, the right repo should be something like: git@github.ibm.com:runtimes/openj9-openjdk-jdk**-zos.git and for now there is only jdk11
env.JDK_REPO = params.JDK_REPO ? params.JDK_REPO : ""
if (env.SPEC.startsWith('zos')) {
ADOPTOPENJDK_REPO = ADOPTOPENJDK_REPO.replace("https://github.com/","git@github.com:")
OPENJ9_REPO = OPENJ9_REPO.replace("https://github.com/","git@github.com:")
if(!params.USE_TESTENV_PROPERTIES){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rebase the PR? USE_TESTENV_PROPERTIES change is already delivered.

ADOPTOPENJDK_REPO = params.ADOPTOPENJDK_REPO ? params.ADOPTOPENJDK_REPO : "https://github.com/adoptium/aqa-tests.git"
OPENJ9_REPO = params.OPENJ9_REPO ? params.OPENJ9_REPO : "https://github.com/eclipse-openj9/openj9.git"
String[] tkg = getGitRepoBranch(params.TKG_OWNER_BRANCH, "adoptium:master", "TKG")
TKG_REPO = tkg[0]
TKG_BRANCH = tkg[1]
//For Zos, the right repo should be something like: git@github.ibm.com:runtimes/openj9-openjdk-jdk**-zos.git and for now there is only jdk11
env.JDK_REPO = params.JDK_REPO ? params.JDK_REPO : ""
if (env.SPEC.startsWith('zos')) {
ADOPTOPENJDK_REPO = ADOPTOPENJDK_REPO.replace("https://github.com/","git@github.com:")
OPENJ9_REPO = OPENJ9_REPO.replace("https://github.com/","git@github.com:")
}
OPENJ9_BRANCH = params.OPENJ9_BRANCH ? params.OPENJ9_BRANCH : "master"
}

PLATFORM = params.PLATFORM ? params.PLATFORM : ""
ADOPTOPENJDK_BRANCH = params.ADOPTOPENJDK_BRANCH ? params.ADOPTOPENJDK_BRANCH : "master"
CLONE_OPENJ9 = params.CLONE_OPENJ9 ? params.CLONE_OPENJ9 : "true"
OPENJ9_BRANCH = params.OPENJ9_BRANCH ? params.OPENJ9_BRANCH : "master"
CUSTOM_TARGET = params.CUSTOM_TARGET ? params.CUSTOM_TARGET : ""
UPSTREAM_JOB_NAME = params.UPSTREAM_JOB_NAME ? params.UPSTREAM_JOB_NAME : ""
UPSTREAM_JOB_NUMBER = params.UPSTREAM_JOB_NUMBER ? params.UPSTREAM_JOB_NUMBER : ""
Expand Down Expand Up @@ -382,34 +382,42 @@ def setup() {
}
}
}
OPENJ9_REPO_OPTION = ""
OPENJ9_BRANCH_OPTION = ""
TKG_REPO_OPTION = ""
TKG_BRANCH_OPTION = ""
if(!params.USE_TESTENV_PROPERTIES){
OPENJ9_REPO_OPTION = "--openj9_repo ${OPENJ9_REPO}"
OPENJ9_BRANCH_OPTION = "--openj9_branch ${OPENJ9_BRANCH}"
TKG_REPO_OPTION = "--tkg_repo ${TKG_REPO}"
TKG_BRANCH_OPTION = "--tkg_branch ${TKG_BRANCH}"
}
CLONE_OPENJ9_OPTION = (params.CLONE_OPENJ9) ? "--clone_openj9 ${params.CLONE_OPENJ9}" : ""
OPENJ9_REPO_OPTION = "--openj9_repo ${OPENJ9_REPO}"
OPENJ9_BRANCH_OPTION = "--openj9_branch ${OPENJ9_BRANCH}"
OPENJ9_SHA_OPTION = (params.OPENJ9_SHA) ? "--openj9_sha ${params.OPENJ9_SHA}" : ""
TKG_REPO_OPTION = "--tkg_repo ${TKG_REPO}"
TKG_BRANCH_OPTION = "--tkg_branch ${TKG_BRANCH}"
JDK_VERSION_OPTION = env.JDK_VERSION ? "-j ${env.JDK_VERSION}" : ""
JDK_IMPL_OPTION = env.JDK_IMPL ? "-i ${env.JDK_IMPL}" : ""

// system test repository exports to be used by system/common.xml
if (params.ADOPTOPENJDK_SYSTEMTEST_OWNER_BRANCH) {
if(!params.USE_TESTENV_PROPERTIES && params.ADOPTOPENJDK_SYSTEMTEST_OWNER_BRANCH){
String[] adoptSystemTest = getGitRepoBranch(params.ADOPTOPENJDK_SYSTEMTEST_OWNER_BRANCH, "adoptium:master", "aqa-systemtest")
env.ADOPTOPENJDK_SYSTEMTEST_REPO = adoptSystemTest[0]
env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = adoptSystemTest[1]
}

if (params.OPENJ9_SYSTEMTEST_OWNER_BRANCH) {
if (!params.USE_TESTENV_PROPERTIES && params.OPENJ9_SYSTEMTEST_OWNER_BRANCH) {
String[] openj9SystemTest = getGitRepoBranch(params.OPENJ9_SYSTEMTEST_OWNER_BRANCH, "eclipse:master", "openj9-systemtest")
env.OPENJ9_SYSTEMTEST_REPO = openj9SystemTest[0]
env.OPENJ9_SYSTEMTEST_BRANCH = openj9SystemTest[1]
}

if (params.STF_OWNER_BRANCH) {
if (!params.USE_TESTENV_PROPERTIES && params.STF_OWNER_BRANCH) {
String[] stf = getGitRepoBranch(params.STF_OWNER_BRANCH, "adoptium:master", "stf")
env.STF_REPO = stf[0]
env.STF_BRANCH = stf[1]
}




// vendor test
// expect VENDOR_TEST_* to be comma separated string parameters
VENDOR_TEST_REPOS = (params.VENDOR_TEST_REPOS) ? "--vendor_repos \"${params.VENDOR_TEST_REPOS}\"" : ""
Expand All @@ -421,7 +429,10 @@ def setup() {
// Only set image required to false if params is set to false. In get.sh, the default value is true
TEST_IMAGES_REQUIRED = (params.TEST_IMAGES_REQUIRED == false) ? "--test_images_required false" : ""
DEBUG_IMAGES_REQUIRED = (params.DEBUG_IMAGES_REQUIRED == false) ? "--debug_images_required false" : ""

GET_SH_CMD = "./get.sh -s `pwd`/.. -p $PLATFORM -r ${SDK_RESOURCE} ${JDK_VERSION_OPTION} ${JDK_IMPL_OPTION} ${CUSTOMIZED_SDK_URL_OPTION} ${CUSTOMIZED_SDK_SOURCE_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}"


RESOLVED_MAKE = "if [ `uname` = AIX ] || [ `uname` = SunOS ] || [ `uname` = *BSD ]; then MAKE=gmake; else MAKE=make; fi"

dir( WORKSPACE) {
Expand Down Expand Up @@ -470,7 +481,18 @@ def get_sources() {
}
}
}

def exportEnv(){
String makeTestCmd = "bash ./compile.sh ${USE_TESTENV_PROPERTIES}"
dir('aqa-tests') {
if (!env.SPEC.startsWith('zos')) {
sshagent (credentials: ["$params.SSH_AGENT_CREDENTIAL"], ignoreMissing: true) {
sh "$makeTestCmd";
}
} else {
sh "$makeTestCmd";
}
}
}
def makeCompileTest() {
String makeTestCmd = "$RESOLVED_MAKE; cd ./aqa-tests/TKG; \$MAKE compile"
// use sshagent with Jenkins credentials ID for all platforms except zOS
Expand Down Expand Up @@ -538,10 +560,10 @@ def buildTest() {
if(params.CUSTOMIZED_SDK_URL_CREDENTIAL_ID) {
withCredentials([usernamePassword(credentialsId: "${params.CUSTOMIZED_SDK_URL_CREDENTIAL_ID}",
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
makeCompileTest()
exportEnv()
}
} else {
makeCompileTest()
exportEnv()
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
usage ()
{
echo ' [--USE_TESTENV_PROPERTIES ]: use testenv.properties or not'
}

if [ $USE_TESTENV_PROPERTIES == true ];then
while read line; do
export $line
done < ./testenv/testenv.properties
fi
cd ./TKG;
make compile
10 changes: 9 additions & 1 deletion get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,10 @@ getTestKitGen()
{
echo "get testKitGen..."
cd $TESTDIR

if [ "$TKG_REPO" == "" ]
then
TKG_REPO="https://github.com/adoptium/TKG.git"
fi
echo "git clone -q $TKG_REPO"
git clone -q $TKG_REPO
cd TKG
Expand Down Expand Up @@ -640,7 +643,12 @@ checkOpenJ9RepoSHA()
checkRepoSHA "$TESTDIR/openj9"
}


parseCommandLineArgs "$@"
if [[ "$USE_TESTENV_PROPERTIES" == true ]]; then
source ./testenv/testenv.properties
fi

if [[ "$SDKDIR" != "" ]]; then
getBinaryOpenjdk
testJavaVersion
Expand Down
Loading