jjb: tools: depends-on: support babeltrace
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 25 May 2022 19:55:04 +0000 (15:55 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 25 May 2022 19:55:04 +0000 (15:55 -0400)
Propagate *_RUN_TESTS to babeltrace build script to prevent test during
a depends-on gerrit build.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Change-Id: Ia0fcd763d2ce15cc6234587e60c306eece19cf63

jobs/lttng-tools.yaml
scripts/babeltrace/build.sh
scripts/lttng-tools/gerrit-depends-on.sh

index 295b383abb8dd8ff2edb9bf31256680befdd4e06..65b8e08d6b895acbcb249e4df8de95f7718d395c 100644 (file)
          !include-raw-escape: scripts/lttng-tools/gerrit-depends-on.sh
       - inject:
           properties-file: gerrit_custom_dependencies.properties
-      - copyartifact:
-              project: '{bt_job_prefix}babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=std,build=std'
-              which-build: last-successful
-              stable: false
-              filter: 'build/**'
-              target: 'deps'
-              do-not-fingerprint: true
       - conditional-step:
           condition-kind: and
           on-evaluation-failure: run
                 filter: 'build/**'
                 target: 'deps'
                 do-not-fingerprint: true
+      - conditional-step:
+          condition-kind: shell
+          on-evaluation-failure: run
+          condition-command: 'test -z "$GERRIT_DEP_BABELTRACE"'
+          steps:
+            - copyartifact:
+                project: '{bt_job_prefix}babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=std,build=std'
+                which-build: last-successful
+                stable: false
+                filter: 'build/**'
+                target: 'deps'
+                do-not-fingerprint: true
       - shell:
          !include-raw-escape: scripts/lttng-tools/clean_processes_coredump.sh
       - conditional-step:
                    - scripts/common/override-build-std.sh
                    - scripts/common/print.sh
                    - scripts/liburcu/build.sh
+      - conditional-step:
+          condition-kind: shell
+          condition-command: 'test ! -z "$GERRIT_DEP_BABELTRACE"'
+          steps:
+            - shell:
+               !include-raw-escape:
+                   - scripts/common/override-build-std.sh
+                   - scripts/common/print.sh
+                   - scripts/babeltrace/build.sh
       - shell:
          !include-raw-escape: scripts/lttng-tools/gerrit-install-deps.sh
       - conditional-step:
index 2d39c2c0fee0af9b45b6af2da5f650e9bb6fa59e..37a593abdeb7baeda770d3238018a4b46a6d7800 100755 (executable)
@@ -88,6 +88,8 @@ conf=${conf:-}
 build=${build:-}
 cc=${cc:-}
 
+# Controls if the tests are run
+BABELTRACE_RUN_TESTS="${BABELTRACE_RUN_TESTS:=yes}"
 
 SRCDIR="$WORKSPACE/src/babeltrace"
 TMPDIR="$WORKSPACE/tmp"
@@ -394,16 +396,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
-
-# 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 1.5 did not produce TAP logs
-if verlt "$PACKAGE_VERSION" "1.5"; 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"
+if [ "$BABELTRACE_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"
+
+       # The test suite prior to 1.5 did not produce TAP logs
+       if verlt "$PACKAGE_VERSION" "1.5"; 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 33fd9d48ddc0e6ecd6e7b6683ac2d29fdf9e5130..9e607bf257d5efbc7e6389fb030f588ef3e808e3 100755 (executable)
@@ -28,7 +28,7 @@ gerrit_query="&o=CURRENT_REVISION&o=DOWNLOAD_COMMANDS"
 gerrit_json_query=".[0].revisions[.[0].current_revision].ref"
 gerrit_json_query_status=".[0].status"
 
-possible_depends_on="lttng-ust|lttng-modules|userspace-rcu"
+possible_depends_on="lttng-ust|lttng-modules|userspace-rcu|babeltrace"
 re="Depends-on: (${possible_depends_on}): ([^'$'\n'']*)"
 property_file="${WORKSPACE}/gerrit_custom_dependencies.properties"
 
This page took 0.02545 seconds and 4 git commands to generate.