From 9a269c66154080f85e83433b86fdacec726d6865 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Thu, 29 Feb 2024 09:18:16 -0500 Subject: [PATCH] jjb: Test java agents using log4j 2.17.1 on slesbuilds Change-Id: Ic881c44577f8dc291363e219386b512bb340cbf8 Signed-off-by: Kienan Stewart --- jobs/lttng-tools.yaml | 2 ++ scripts/lttng-tools/build.sh | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/jobs/lttng-tools.yaml b/jobs/lttng-tools.yaml index 4a4b60d..06c6a53 100644 --- a/jobs/lttng-tools.yaml +++ b/jobs/lttng-tools.yaml @@ -163,6 +163,8 @@ fi if [ "{buildtype}" = "slesbuild" ] ; then echo "TAP_AUTOTIME=0" >> env.properties + # On SLES, force log4j to 2.17.1 + echo "LTTNG_TOOLS_UST_JAVA_TESTS_LOG4J_API_VERSION=2.17.1" >> env.properties fi echo "liburcu_conf=$liburcu_conf" >> env.properties echo "babeltrace_conf=$babeltrace_conf" >> env.properties diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index 9c1a539..6b88a1d 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -583,10 +583,16 @@ if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ ! "$conf" =~ (no-ust|relayd-only) "-DargLine=-Djava.library.path=${WORKSPACE}/deps/build/${LIBDIR_ARCH}" '-Dgroups=!domain:log4j2' ) + env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn -version + + if [[ -n "${LTTNG_TOOLS_UST_JAVA_TESTS_LOG4J_API_VERSION:-}" ]] ; then + env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn versions:use-dep-version -Dincludes=org.apache.logging.log4j:'*' -DdepVersion="${LTTNG_TOOLS_UST_JAVA_TESTS_LOG4J_API_VERSION}" + fi + mkdir -p "${WORKSPACE}/log" env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" lttng-sessiond -b -vvv 1>"${WORKSPACE}/log/lttng-ust-java-tests-lttng-sessiond.log" 2>&1 - env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn "${LTTNG_UST_JAVA_TESTS_MAVEN_OPTS[@]}" clean verify || exit_status=1 + env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn "${LTTNG_UST_JAVA_TESTS_MAVEN_OPTS[@]}" clean compile dependency:build-classpath dependency:tree verify || exit_status=1 killall lttng-sessiond cd "${OWD}" -- 2.34.1