X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=scripts%2Flttng-tools%2Fbuild.sh;h=d1d0d179e5c28fe345ac6d3eba3e81daf019bd72;hb=68d45ec89f33a24291627f820856e9b8a766d24b;hp=8562d1e650c2f3d5aa47f14434041915b2914426;hpb=1ad4c3d00f43ef188e2fb0b71fd8af5ee3591ca7;p=lttng-ci.git diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index 8562d1e..d1d0d17 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -128,6 +128,7 @@ LTTNG_TOOLS_MAKE_CLEAN="${LTTNG_TOOLS_MAKE_CLEAN:-yes}" LTTNG_TOOLS_GEN_COMPILE_COMMANDS="${LTTNG_TOOLS_GEN_COMPILE_COMMANDS:-no}" LTTNG_TOOLS_RUN_TESTS="${LTTNG_TOOLS_RUN_TESTS:-yes}" LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION="${LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION:-no}" +LTTNG_TOOLS_RUN_UST_JAVA_TESTS="${LTTNG_TOOLS_RUN_UST_JAVA_TESTS:-yes}" LTTNG_TOOLS_CLANG_TIDY="${LTTNG_TOOLS_CLANG_TIDY:-no}" SRCDIR="$WORKSPACE/src/lttng-tools" @@ -217,11 +218,6 @@ clang-*) ;; esac -if [ "x${CC:-}" != "x" ]; then - echo "Selected compiler:" - "$CC" -v -fi - # Set platform variables case "$platform" in macos*) @@ -233,18 +229,12 @@ macos*) export LDFLAGS="-L/opt/local/lib $LDFLAGS" export PYTHON="python3" export PYTHON_CONFIG="python3-config" - - LTTNG_TOOLS_RUN_TESTS="no" - LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION="no" ;; cygwin|cygwin64|msys32|msys64) export MAKE=make export TAR=tar export NPROC=nproc - - LTTNG_TOOLS_RUN_TESTS="no" - LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION="no" ;; *) @@ -264,7 +254,9 @@ cygwin|cygwin64|msys32|msys64) fi P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') - DEPS_PYTHON3="$WORKSPACE/deps/build/$LIBDIR/python$P3_VERSION/site-packages" + + # Temporary fix for an issue on debian python >= 3.10, add the 'local' prefix + DEPS_PYTHON3="$WORKSPACE/deps/build/$LIBDIR/python$P3_VERSION/site-packages:$WORKSPACE/deps/build/local/$LIBDIR/python$P3_VERSION/dist-packages" if [ "$LIBDIR" != "$LIBDIR_ARCH" ]; then DEPS_PYTHON3="$DEPS_PYTHON3:$WORKSPACE/deps/build/$LIBDIR_ARCH/python$P3_VERSION/site-packages" fi @@ -321,6 +313,7 @@ static) no-ust) print_header "Conf: Without UST support" + CONF_OPTS+=("--without-lttng-ust") DIST_CONF_OPTS+=("--without-lttng-ust") ;; @@ -498,8 +491,8 @@ if [ "$LTTNG_TOOLS_CLANG_TIDY" = "yes" ]; then fi fi -# Run tests for all configs except 'no-ust' -if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [ "$conf" != "no-ust" ]; then +# Run tests for all configs except 'no-ust' / 'relayd-only' +if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ ! "$conf" =~ (no-ust|relayd-only) ]]; then print_header "Run test suite" # Allow core dumps @@ -531,7 +524,7 @@ if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [ "$conf" != "no-ust" ]; then make --keep-going check || exit_status=1 - # Copy tap logs for the jenkins tap parser before cleaning the build dir + # Copy tap logs for the jenkins tap parser before cleaning the build dir rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$TAPDIR" # Copy the test suites top-level log which includes all tests failures @@ -544,7 +537,49 @@ if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [ "$conf" != "no-ust" ]; then prove --merge -v --exec '' - < long_regression --archive "$TAPDIR/long_regression/" || exit_status=1 cd .. fi -else + + if [ "$LTTNG_TOOLS_RUN_UST_JAVA_TESTS" = "yes" ] && [ "$conf" = "agents" ] && \ + [ "$platform" = "bionic-amd64" ] && [ "$LTTNG_TOOLS_MAKE_INSTALL" = "yes" ] ; then + print_header "Run lttng-ust-java-tests" + # Git Source + LTTNG_UST_JAVA_TESTS_GIT_SOURCE="${LTTNG_UST_JAVA_TESTS_GIT_SOURCE:-https://github.com/lttng/lttng-ust-java-tests.git}" + LTTNG_UST_JAVA_TESTS_GIT_BRANCH="${LTTNG_UST_JAVA_TESTS_GIT_BRANCH:-master}" + + OWD="$(pwd)" + cd .. + git clone -b "${LTTNG_UST_JAVA_TESTS_GIT_BRANCH}" "${LTTNG_UST_JAVA_TESTS_GIT_SOURCE}" lttng-ust-java-tests + cd lttng-ust-java-tests + + LTTNG_UST_JAVA_TESTS_ENV=( + "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/" + PATH="${WORKSPACE}/build/bin/:$PATH" + LD_LIBRARY_PATH="${WORKSPACE}/build/lib:$LD_LIBRARY_PATH" + LTTNG_UST_DEBUG=1 + LTTNG_CONSUMERD32_BIN="${WORKSPACE}/build/lib/lttng/libexec/lttng-consumerd" + LTTNG_CONSUMERD64_BIN="${WORKSPACE}/build/lib/lttng/libexec/lttng-consumerd" + LTTNG_SESSION_CONFIG_XSD_PATH="${WORKSPACE}/build/share/xml/lttng" + BABELTRACE_PLUGIN_PATH="${WORKSPACE}/deps/build/lib/babeltrace2/plugins" + LIBBABELTRACE2_PLUGIN_PROVIDER_DIR="${WORKSPACE}/deps/build/lib/babeltrace2/plugin-providers" + ) + LTTNG_UST_JAVA_TESTS_MAVEN_OPTS=( + "-Dmaven.test.failure.ignore=true" + "-Dcommon-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-common.jar" + "-Djul-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-jul.jar" + "-Dlog4j-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-log4j.jar" + "-Dlog4j2-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-log4j2.jar" + "-DargLine=-Djava.library.path=${WORKSPACE}/deps/build/lib" + '-Dgroups=!domain:log4j2' + ) + env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn -version + 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 + killall lttng-sessiond + + cd "${OWD}" + fi +fi + +if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ "$conf" =~ (no-ust|relayd-only) ]]; then # The TAP plugin will fail the job if no test logs are present mkdir -p "$TAPDIR/no-tests" echo "1..1" > "$TAPDIR/no-tests/tests.log"