jjb: tools: add post-build action to gather tap logs
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 22 Feb 2021 22:20:31 +0000 (17:20 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 22 Feb 2021 22:44:46 +0000 (17:44 -0500)
Currently, if a build abort (timeout etc.) we do not gather the tap logs
and this can lead to difficulty in figuring out the causes of the
problem.

The action is performed only on Abort.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
jobs/lttng-tools.yaml
scripts/lttng-tools/tap_aborted.sh [new file with mode: 0755]

index 70cbcde2218f472ba86b360764f23078279a5b33..8260af6e3743cc46c2219e0f2fefbe05a730b995 100644 (file)
 - lttng-tools_build_publishers_dev: &lttng-tools_build_publishers_dev
     name: 'lttng-tools_build_publishers_dev'
     publishers:
+      - postbuildscript:
+          mark-unstable-if-failed: false
+          builders:
+            - role: SLAVE
+              build-on:
+                  - ABORTED
+              build-steps:
+                  - shell:
+                      !include-raw-escape: scripts/lttng-tools/tap_aborted.sh
       - postbuildscript:
           mark-unstable-if-failed: true
           builders:
 - lttng-tools_build_publishers_prod: &lttng-tools_build_publishers_prod
     name: 'lttng-tools_build_publishers_prod'
     publishers:
+      - postbuildscript:
+          mark-unstable-if-failed: false
+          builders:
+            - role: SLAVE
+              build-on:
+                  - ABORTED
+              build-steps:
+                  - shell:
+                      !include-raw-escape: scripts/lttng-tools/tap_aborted.sh
       - postbuildscript:
           mark-unstable-if-failed: true
           builders:
     <<: *lttng-tools_build_builders_gerrit
 
     publishers:
+      - postbuildscript:
+          mark-unstable-if-failed: false
+          builders:
+            - role: SLAVE
+              build-on:
+                  - ABORTED
+              build-steps:
+                  - shell:
+                      !include-raw-escape: scripts/lttng-tools/tap_aborted.sh
       - postbuildscript:
           mark-unstable-if-failed: true
           builders:
           !include-raw-escape: scripts/lttng-tools/release.sh
 
     publishers:
+      - postbuildscript:
+          mark-unstable-if-failed: false
+          builders:
+            - role: SLAVE
+              build-on:
+                  - ABORTED
+              build-steps:
+                  - shell:
+                      !include-raw-escape: scripts/lttng-tools/tap_aborted.sh
       - postbuildscript:
           mark-unstable-if-failed: true
           builders:
diff --git a/scripts/lttng-tools/tap_aborted.sh b/scripts/lttng-tools/tap_aborted.sh
new file mode 100755 (executable)
index 0000000..07bbaa4
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Copyright (C) 2021 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -exu
+
+# Required variables
+WORKSPACE=${WORKSPACE:-}
+
+SRCDIR="$WORKSPACE/src/lttng-tools"
+TAPDIR="$WORKSPACE/tap"
+
+cd "$SRCDIR"
+
+# Try to fetch all tap logs.
+rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$TAPDIR"
+
+# TAP plugin is having a hard time with .yml files.
+find "$TAPDIR" -name "meta.yml" -exec rm -f {} \;
+
+# EOF
This page took 0.025875 seconds and 4 git commands to generate.