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

Apply USE_TESTENV_PROPERTIES only on container tests with aqa-tests #5406

Merged
merged 1 commit into from
Jun 28, 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
1 change: 1 addition & 0 deletions external/criu-functional/test.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
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.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
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-ubi-portable-checkpoint/test.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github_url="https://github.com/adoptium/aqa-tests.git"
test_results="testResults"
gradle_version="5.1"
environment_variable="MODE=java"
Expand Down
31 changes: 19 additions & 12 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 aqa_tests_repo=$2
local github_url=$2

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

Expand Down Expand Up @@ -506,29 +506,36 @@ 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 aqa_tests_repo=$3
local aqa_tests_branch=$4
local github_url=$3

# Cause Test name to be capitalized
test_tag="$(sanitize_test_names ${test} | tr a-z A-Z)_TAG"
if [[ "$test_tag" != *"CRIU"* && "$test_tag" != *"TCK"* ]]; then
aqa_tests_branch=$test_tag
git_branch_tag="master"
if [[ "${github_url}" == *"aqa-tests"* ]]; then
if [[ ! -z ${USE_TESTENV_PROPERTIES} ]]; then
if [[ "${USE_TESTENV_PROPERTIES}" == "true" && ! -z ${ADOPTOPENJDK_REPO} && ! -z ${ADOPTOPENJDK_BRANCH} ]]; then
github_url=${ADOPTOPENJDK_REPO}
git_branch_tag=${ADOPTOPENJDK_BRANCH}
echo -e "\nENV USE_TESTENV_PROPERTIES=true\n" >> ${file}
fi
fi
else
git_branch_tag=\$${test_tag}
fi

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

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

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

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