The important part is how lttng-tools behave. Running the tests of
the dependencies is redundant and only leads to wasted time and CPU time.
The RUN_TESTS flag is now "namespaced" to ensure that we can turn on and
off tests for each projects if necessary.
LTTNG_TOOLS_RUN_TESTS
LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION
LTTNG_UST_RUN_TESTS
USERSPACE_RCU_RUN_TESTS
For now only `LTTNG_UST_RUN_TESTS` and `USERSPACE_RCU_RUN_TESTS` can be
manipulated via environment injection. The lttng-tools build script
is a bit more complex and manipulates the value themselves. More work
will be required if we want to control the flags of the lttng-tools
build script.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
build=${build:-}
cc=${cc:-}
build=${build:-}
cc=${cc:-}
+# Controls if the tests are run
+USERSPACE_RCU_RUN_TESTS="${USERSPACE_RCU_RUN_TESTS:=yes}"
SRCDIR="$WORKSPACE/src/liburcu"
TMPDIR="$WORKSPACE/tmp"
SRCDIR="$WORKSPACE/src/liburcu"
TMPDIR="$WORKSPACE/tmp"
# Run tests, don't fail now, we want to run the archiving steps
failed_tests=0
# Run tests, don't fail now, we want to run the archiving steps
failed_tests=0
-$MAKE --keep-going check || failed_tests=1
-# Only run regtest for 0.9 and up
-if vergte "$PACKAGE_VERSION" "0.9"; then
- $MAKE --keep-going regtest || failed_tests=1
-fi
+if [ "$USERSPACE_RCU_RUN_TESTS" = "yes" ]; then
+ $MAKE --keep-going check || failed_tests=1
+ # Only run regtest for 0.9 and up
+ if vergte "$PACKAGE_VERSION" "0.9"; then
+ $MAKE --keep-going regtest || failed_tests=1
+ fi
-# Copy tap logs for the jenkins tap parser before cleaning the build dir
-rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$WORKSPACE/tap"
+ # Copy tap logs for the jenkins tap parser before cleaning the build dir
+ rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$WORKSPACE/tap"
-# The test suite prior to 0.11 did not produce TAP logs
-if verlt "$PACKAGE_VERSION" "0.11"; then
- mkdir -p "$WORKSPACE/tap/no-log"
- echo "1..1" > "$WORKSPACE/tap/no-log/tests.log"
- echo "ok 1 - Test suite doesn't support logging" >> "$WORKSPACE/tap/no-log/tests.log"
+ # The test suite prior to 0.11 did not produce TAP logs
+ if verlt "$PACKAGE_VERSION" "0.11"; then
+ mkdir -p "$WORKSPACE/tap/no-log"
+ echo "1..1" > "$WORKSPACE/tap/no-log/tests.log"
+ echo "ok 1 - Test suite doesn't support logging" >> "$WORKSPACE/tap/no-log/tests.log"
+ fi
fi
# Clean the build directory
fi
# Clean the build directory
export PYTHON="python3"
export PYTHON_CONFIG="python3-config"
export PYTHON="python3"
export PYTHON_CONFIG="python3-config"
+ LTTNG_TOOLS_RUN_TESTS="no"
export PYTHON_CONFIG="python3-config"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/pkgconfig"
export PYTHON_CONFIG="python3-config"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/pkgconfig"
+ LTTNG_TOOLS_RUN_TESTS="no"
export PYTHON="python3.9"
export PYTHON_CONFIG="python3.9-config"
export PYTHON="python3.9"
export PYTHON_CONFIG="python3.9-config"
+ LTTNG_TOOLS_RUN_TESTS="no"
;;
cygwin|cygwin64|msys32|msys64)
;;
cygwin|cygwin64|msys32|msys64)
export TAR=tar
export NPROC=nproc
export TAR=tar
export NPROC=nproc
+ LTTNG_TOOLS_RUN_TESTS="no"
export TAR=tar
export NPROC=nproc
export TAR=tar
export NPROC=nproc
+ LTTNG_TOOLS_RUN_TESTS="yes"
PYTHON2=python2
PYTHON3=python3
PYTHON2=python2
PYTHON3=python3
case "$test_type" in
full)
case "$test_type" in
full)
- RUN_TESTS_LONG_REGRESSION="yes"
+ LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION="yes"
- RUN_TESTS_LONG_REGRESSION="no"
+ LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION="no"
# Run tests for all configs except 'no-ust'
failed_tests=0
# Run tests for all configs except 'no-ust'
failed_tests=0
-if [ "$RUN_TESTS" = "yes" ] && [ "$conf" != "no-ust" ]; then
+if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [ "$conf" != "no-ust" ]; then
# Allow core dumps
ulimit -c unlimited
# Allow core dumps
ulimit -c unlimited
- if [ "$RUN_TESTS_LONG_REGRESSION" = "yes" ]; then
+ if [ "$LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION" = "yes" ]; then
cd tests
mkdir -p "$TAPDIR/long_regression"
prove --merge -v --exec '' - < long_regression --archive "$TAPDIR/long_regression/" || failed_tests=1
cd tests
mkdir -p "$TAPDIR/long_regression"
prove --merge -v --exec '' - < long_regression --archive "$TAPDIR/long_regression/" || failed_tests=1
# Export the GERRIT_DEP_... into the property file for further jenkins usage
echo "GERRIT_DEP_${project_sanitize^^}=${gerrit_id}" >> "$property_file"
# Export the GERRIT_DEP_... into the property file for further jenkins usage
echo "GERRIT_DEP_${project_sanitize^^}=${gerrit_id}" >> "$property_file"
+ # Deactivate tests for the project
+ echo "${project_sanitize^^}_RUN_TESTS=no" >> "$property_file"
# Get the change latest ref
ref=$(curl "${gerrit_url}/changes/${gerrit_id}${gerrit_query}" | tail -n+2 | jq -r "$gerrit_json_query")
# Get the change latest ref
ref=$(curl "${gerrit_url}/changes/${gerrit_id}${gerrit_query}" | tail -n+2 | jq -r "$gerrit_json_query")
build=${build:-}
cc=${cc:-}
build=${build:-}
cc=${cc:-}
+# Controls if the tests are run
+LTTNG_UST_RUN_TESTS="${LTTNG_UST_RUN_TESTS:=yes}"
DEPS_INC="$WORKSPACE/deps/build/include"
DEPS_LIB="$WORKSPACE/deps/build/lib"
DEPS_INC="$WORKSPACE/deps/build/include"
DEPS_LIB="$WORKSPACE/deps/build/lib"
# Run tests, don't fail now, we want to run the archiving steps
failed_tests=0
# Run tests, don't fail now, we want to run the archiving steps
failed_tests=0
-$MAKE --keep-going check || failed_tests=1
+if [ "$LTTNG_UST_RUN_TESTS" = "yes" ]; then
+ $MAKE --keep-going check || failed_tests=1
-# Copy tap logs for the jenkins tap parser before cleaning the build dir
-rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$WORKSPACE/tap"
+ # Copy tap logs for the jenkins tap parser before cleaning the build dir
+ rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$WORKSPACE/tap"
-# The test suite prior to 2.8 did not produce TAP logs
-if verlt "$PACKAGE_VERSION" "2.8"; then
- mkdir -p "$WORKSPACE/tap/no-log"
- echo "1..1" > "$WORKSPACE/tap/no-log/tests.log"
- echo "ok 1 - Test suite doesn't support logging" >> "$WORKSPACE/tap/no-log/tests.log"
+ # The test suite prior to 2.8 did not produce TAP logs
+ if verlt "$PACKAGE_VERSION" "2.8"; then
+ mkdir -p "$WORKSPACE/tap/no-log"
+ echo "1..1" > "$WORKSPACE/tap/no-log/tests.log"
+ echo "ok 1 - Test suite doesn't support logging" >> "$WORKSPACE/tap/no-log/tests.log"
+ fi
fi
# Clean the build directory
fi
# Clean the build directory