From a5402260e9159e2d4cd22c2358eff9095599191a Mon Sep 17 00:00:00 2001 From: Jiri Date: Mon, 12 Aug 2024 15:16:44 +0200 Subject: [PATCH 1/2] Propagate JAVA_TOOL_OPTIONS down to external tests in container --- external/dockerfile_functions.sh | 6 +++--- external/jenkins/test.sh | 4 ++-- external/scala/test.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/external/dockerfile_functions.sh b/external/dockerfile_functions.sh index ea9b9f81dd..0259ef1fa1 100755 --- a/external/dockerfile_functions.sh +++ b/external/dockerfile_functions.sh @@ -197,11 +197,11 @@ print_jdk_install() { "\n\t PATH=\"/opt/java/openjdk/bin:\$PATH\" " \ "\n" >> ${file} - echo -e "\nENV JAVA_TOOL_OPTIONS=\"-XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle\" " \ + echo -e "\nENV JAVA_TOOL_OPTIONS=\"$JAVA_TOOL_OPTIONS -XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle\" " \ "\n" >> ${file} echo -e "\nENV RANDFILE=/tmp/.rnd \\" \ - "\n\t OPENJ9_JAVA_OPTIONS=\"-XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle -Dosgi.checkConfiguration=false\" " \ + "\n\t OPENJ9_JAVA_OPTIONS=\"$OPENJ9_JAVA_OPTIONS -XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle -Dosgi.checkConfiguration=false\" " \ "\n" >> ${file} } @@ -445,7 +445,7 @@ print_maven_install() { print_java_tool_options() { local file=$1 - echo -e "ENV JAVA_TOOL_OPTIONS=\"-Dfile.encoding=UTF8 -Djava.security.egd=file:/dev/./urandom\"\n" >> ${file} + echo -e "ENV JAVA_TOOL_OPTIONS=\"$JAVA_TOOL_OPTIONS -Dfile.encoding=UTF8 -Djava.security.egd=file:/dev/./urandom\"\n" >> ${file} } print_environment_variable() { diff --git a/external/jenkins/test.sh b/external/jenkins/test.sh index a78b9054df..c7dc1a0754 100644 --- a/external/jenkins/test.sh +++ b/external/jenkins/test.sh @@ -16,7 +16,7 @@ source $(dirname "$0")/test_base_functions.sh # Set up Java to be used by the jenkins test echo_setup -export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" +export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -Dfile.encoding=UTF8" #begin jenkins test set -e @@ -29,4 +29,4 @@ echo "Run jenkins test phase alone with cmd: \"mvn surefire:test\"" && \ mvn --batch-mode surefire:test -Denforcer.fail=false test_exit_code=$? find ./ -type d -name 'surefire-reports' -exec cp -r "{}" /testResults \; -exit $test_exit_code \ No newline at end of file +exit $test_exit_code diff --git a/external/scala/test.sh b/external/scala/test.sh index fb2d2b40a1..322405c426 100644 --- a/external/scala/test.sh +++ b/external/scala/test.sh @@ -17,7 +17,7 @@ source $(dirname "$0")/test_base_functions.sh echo_setup TEST_SUITE=$1 -export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" +export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -Dfile.encoding=UTF8" #begin scala test set -e @@ -27,4 +27,4 @@ sbt -Dsbt.log.noformat=true "scala -version" echo "Begin to execute Scala test with cmd: sbt \"partest $TEST_SUITE\"" && \ sbt -Dsbt.log.noformat=true "partest --terse $TEST_SUITE" -set +e \ No newline at end of file +set +e From 4c47a36e66a0b6de472a9f1f1d5e8c0ac8e0ef3f Mon Sep 17 00:00:00 2001 From: judovana Date: Fri, 16 Aug 2024 07:48:16 +0200 Subject: [PATCH 2/2] Update external/dockerfile_functions.sh Co-authored-by: Martijn Verburg --- external/dockerfile_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/dockerfile_functions.sh b/external/dockerfile_functions.sh index 0259ef1fa1..e1faba04ff 100755 --- a/external/dockerfile_functions.sh +++ b/external/dockerfile_functions.sh @@ -201,7 +201,7 @@ print_jdk_install() { "\n" >> ${file} echo -e "\nENV RANDFILE=/tmp/.rnd \\" \ - "\n\t OPENJ9_JAVA_OPTIONS=\"$OPENJ9_JAVA_OPTIONS -XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle -Dosgi.checkConfiguration=false\" " \ + "\n\t OPENJ9_JAVA_OPTIONS=\"$OPENJ9_JAVA_OPTIONS -XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle -Dosgi.checkConfiguration=false\" " \ "\n" >> ${file} }