jjb: depends-on: do not run tests of dependencies
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 27 Sep 2021 21:25:45 +0000 (17:25 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 28 Sep 2021 21:11:44 +0000 (17:11 -0400)
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>
scripts/liburcu/build.sh
scripts/lttng-tools/build.sh
scripts/lttng-tools/gerrit-depends-on.sh
scripts/lttng-ust/build.sh

index edf47953290901d4226463f5ffd524b4ebbb6406..1fd0e95d5dbf95a33db481c1e8b65b04d9ebbb6f 100755 (executable)
@@ -89,6 +89,8 @@ conf=${conf:-}
 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"
@@ -349,20 +351,22 @@ $MAKE install DESTDIR="$WORKSPACE"
 
 # 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
index 3d0be52c87420f64a91a80e85dedacbbe99f602a..e4a85ac31f0cb64f8676459c9a4e0304da75ad11 100755 (executable)
@@ -227,7 +227,7 @@ sol10-i386)
     export PYTHON="python3"
     export PYTHON_CONFIG="python3-config"
 
-    RUN_TESTS="no"
+    LTTNG_TOOLS_RUN_TESTS="no"
     ;;
 
 sol11-i386)
@@ -240,7 +240,7 @@ sol11-i386)
     export PYTHON_CONFIG="python3-config"
     export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/pkgconfig"
 
-    RUN_TESTS="no"
+    LTTNG_TOOLS_RUN_TESTS="no"
     ;;
 
 macos*)
@@ -253,7 +253,7 @@ macos*)
     export PYTHON="python3.9"
     export PYTHON_CONFIG="python3.9-config"
 
-    RUN_TESTS="no"
+    LTTNG_TOOLS_RUN_TESTS="no"
     ;;
 
 cygwin|cygwin64|msys32|msys64)
@@ -261,7 +261,7 @@ cygwin|cygwin64|msys32|msys64)
     export TAR=tar
     export NPROC=nproc
 
-    RUN_TESTS="no"
+    LTTNG_TOOLS_RUN_TESTS="no"
     ;;
 
 *)
@@ -269,7 +269,7 @@ cygwin|cygwin64|msys32|msys64)
     export TAR=tar
     export NPROC=nproc
 
-    RUN_TESTS="yes"
+    LTTNG_TOOLS_RUN_TESTS="yes"
 
     PYTHON2=python2
     PYTHON3=python3
@@ -284,10 +284,10 @@ esac
 
 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"
     ;;
 esac
 
@@ -450,7 +450,7 @@ $MAKE install DESTDIR="$WORKSPACE"
 
 # 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
 
@@ -488,7 +488,7 @@ if [ "$RUN_TESTS" = "yes" ] && [ "$conf" != "no-ust" ]; then
        cd ..
     fi
 
-    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
index 42b6225cbc428e902359a184ad94e40b1785c212..b917c23aecf77a57d7f2e79617f8077a0aa8ec4e 100755 (executable)
@@ -71,6 +71,8 @@ git rev-list --format=%B --max-count=1 HEAD | while read -r line; do
 
     # 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")
index a3a33e82c3a4c5b3eaf1204b08ed2155a96ef9f4..37763e65cbbdbc5d78f2bd4d52f4066b2916fb7d 100755 (executable)
@@ -89,6 +89,8 @@ conf=${conf:-}
 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"
@@ -323,16 +325,18 @@ $MAKE install DESTDIR="$WORKSPACE"
 
 # 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
This page took 0.026942 seconds and 4 git commands to generate.