jjb: Test java agents using log4j 2.17.1 on slesbuilds
authorKienan Stewart <kstewart@efficios.com>
Thu, 29 Feb 2024 14:18:16 +0000 (09:18 -0500)
committerKienan Stewart <kstewart@efficios.com>
Thu, 29 Feb 2024 15:14:40 +0000 (10:14 -0500)
Change-Id: Ic881c44577f8dc291363e219386b512bb340cbf8
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
jobs/lttng-tools.yaml
scripts/lttng-tools/build.sh

index 4a4b60de035661d2bbd1e4039a05aae54efc87d2..06c6a538dd586ecb75205bbf32e93d320558c7d0 100644 (file)
           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
index 9c1a53988db1c54ee9184a736b0b08a909c8f136..6b88a1d278cf6f9a1ebfd95840cd7df8e5f88b37 100755 (executable)
@@ -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}"
This page took 0.026152 seconds and 4 git commands to generate.