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

Support container tests inherit Jenkins aqa-tests repo and testenv #5356

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ def setupEnv() {

env.SPEC = "${SPEC}"
if(!params.USE_TESTENV_PROPERTIES){
ADOPTOPENJDK_REPO = params.ADOPTOPENJDK_REPO ? params.ADOPTOPENJDK_REPO : "https://github.com/adoptium/aqa-tests.git"
env.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: [email protected]: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/","[email protected]:")
env.ADOPTOPENJDK_REPO = env.ADOPTOPENJDK_REPO.replace("https://github.com/","[email protected]:")
OPENJ9_REPO = OPENJ9_REPO.replace("https://github.com/","[email protected]:")
}
OPENJ9_BRANCH = params.OPENJ9_BRANCH ? params.OPENJ9_BRANCH : "master"
}

PLATFORM = params.PLATFORM ? params.PLATFORM : ""
ADOPTOPENJDK_BRANCH = params.ADOPTOPENJDK_BRANCH ? params.ADOPTOPENJDK_BRANCH : "master"
env.ADOPTOPENJDK_BRANCH = params.ADOPTOPENJDK_BRANCH ? params.ADOPTOPENJDK_BRANCH : "master"
CLONE_OPENJ9 = params.CLONE_OPENJ9 ? params.CLONE_OPENJ9 : "true"
CUSTOM_TARGET = params.CUSTOM_TARGET ? params.CUSTOM_TARGET : ""
UPSTREAM_JOB_NAME = params.UPSTREAM_JOB_NAME ? params.UPSTREAM_JOB_NAME : ""
Expand Down Expand Up @@ -121,7 +121,7 @@ def setupEnv() {
// to take personal repo and branch.
// Therefore, set LIGHT_WEIGHT_CHECKOUTto false and GENERATE_JOBS to true.
// This is a known Jenkins issue: https://issues.jenkins.io/browse/JENKINS-42971
if (!ADOPTOPENJDK_REPO.contains("adoptium/aqa-tests")) {
if (!env.ADOPTOPENJDK_REPO.contains("adoptium/aqa-tests")) {
env.LIGHT_WEIGHT_CHECKOUT = false
env.GENERATE_JOBS = true
echo "ADOPTOPENJDK_REPO is set to personal repo in Grinder. Auto-set LIGHT_WEIGHT_CHECKOUT: ${env.LIGHT_WEIGHT_CHECKOUT} and GENERATE_JOBS: ${env.GENERATE_JOBS}"
Expand Down Expand Up @@ -1072,7 +1072,7 @@ def archiveAQAvitFiles() {
if (params.ARTIFACTORY_SERVER) {
def currentDate = new Date()
def currentDateTime = currentDate.format("yyyyMMddHHmmss", TimeZone.getTimeZone('UTC'))
def uploadDir = "AQAvit/${JDK_IMPL}/${ADOPTOPENJDK_BRANCH}/${JDK_VERSION}/${PLATFORM}/${currentDateTime}"
def uploadDir = "AQAvit/${JDK_IMPL}/${env.ADOPTOPENJDK_BRANCH}/${JDK_VERSION}/${PLATFORM}/${currentDateTime}"
uploadToArtifactory("${env.WORKSPACE}/**/*.tap", uploadDir)
}
}
Expand Down
1 change: 0 additions & 1 deletion external/criu-functional/test.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github_url="https://github.com/adoptium/aqa-tests.git"
test_results="testResults"
gradle_version="5.1"
environment_variable="MODE=java CC=gcc-7 CXX=g++-7"
Expand Down
1 change: 1 addition & 0 deletions external/criu-functional/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export JDK_VERSION=
echo "TEST_JDK_HOME has been unset, use auto-detect instead."
export DYNAMIC_COMPILE=true
export BUILD_LIST=functional
echo "USE_TESTENV_PROPERTIES is $USE_TESTENV_PROPERTIES"

cd /aqa-tests
./get.sh
Expand Down
1 change: 0 additions & 1 deletion external/criu-portable-checkpoint/test.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github_url="https://github.com/adoptium/aqa-tests.git"
test_results="testResults"
gradle_version="5.1"
environment_variable="MODE=java CC=gcc-7 CXX=g++-7"
Expand Down
1 change: 1 addition & 0 deletions external/criu-portable-checkpoint/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export JDK_VERSION=
echo "JDK_VERSION has been unset, use auto-detect instead."
export DYNAMIC_COMPILE=true
export BUILD_LIST=functional
echo "USE_TESTENV_PROPERTIES is $USE_TESTENV_PROPERTIES"

cd /aqa-tests
./get.sh
Expand Down
1 change: 0 additions & 1 deletion external/criu-ubi-portable-checkpoint/test.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github_url="https://github.com/adoptium/aqa-tests.git"
test_results="testResults"
gradle_version="5.1"
environment_variable="MODE=java"
Expand Down
1 change: 1 addition & 0 deletions external/criu-ubi-portable-checkpoint/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export JDK_VERSION=
echo "JDK_VERSION has been unset, use auto-detect instead."
export DYNAMIC_COMPILE=true
export BUILD_LIST=functional
echo "USE_TESTENV_PROPERTIES is $USE_TESTENV_PROPERTIES"

cd /aqa-tests
./get.sh
Expand Down
21 changes: 11 additions & 10 deletions external/dockerfile_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,10 @@ print_environment_variable() {

print_home_path() {
local file=$1
local github_url=$2
local aqa_tests_repo=$2

# Get Github folder name
local folder="$(echo ${github_url} | awk -F'/' '{print $NF}' | sed 's/.git//g')"
local folder="$(echo ${aqa_tests_repo} | awk -F'/' '{print $NF}' | sed 's/.git//g')"
echo -e "ENV TEST_HOME /${folder}\n" >> ${file}
}

Expand Down Expand Up @@ -506,28 +506,29 @@ print_testInfo_env() {
"\nENV JDK_VERSION=${version}" \
"\nENV JDK_IMPL=${vm}" \
"\n" >> ${file}
echo -e "\nENV USE_TESTENV_PROPERTIES ${USE_TESTENV_PROPERTIES} \n" >> ${file}
}

print_clone_project() {
local file=$1
local test=$2
local github_url=$3
local aqa_tests_repo=$3
local aqa_tests_branch=$4

# Cause Test name to be capitalized
test_tag="$(sanitize_test_names ${test} | tr a-z A-Z)_TAG"
git_branch_tag="master"
if [[ "$test_tag" != *"CRIU"* && "$test_tag" != *"TCK"* ]]; then
git_branch_tag=$test_tag
aqa_tests_branch=$test_tag
fi

# Get Github folder name
folder="$(echo ${github_url} | awk -F'/' '{print $NF}' | sed 's/.git//g')"
folder="$(echo ${aqa_tests_repo} | awk -F'/' '{print $NF}' | sed 's/.git//g')"

echo -e "# Clone ${test} source" \
"\nENV ${test_tag}=\$${test_tag}" \
"\nRUN git clone ${github_url}" \
"\nRUN git clone ${aqa_tests_repo}" \
"\nWORKDIR /${folder}/" \
"\nRUN git checkout \$${git_branch_tag}" \
"\nRUN git checkout ${aqa_tests_branch}" \
"\nWORKDIR /" \
"\n" >> ${file}
}
Expand Down Expand Up @@ -656,9 +657,9 @@ generate_dockerfile() {
print_test_results ${file};
fi

print_home_path ${file} ${github_url};
print_home_path ${file} ${ADOPTOPENJDK_REPO};
print_testInfo_env ${test} ${tag_version} ${os} ${version} ${vm}
print_clone_project ${file} ${test} ${github_url};
print_clone_project ${file} ${test} ${ADOPTOPENJDK_REPO} ${ADOPTOPENJDK_BRANCH} ;
print_test_files ${file} ${test} ${localPropertyFile};

if [[ "$check_external_custom_test" == "1" ]]; then
Expand Down