From: Jonathan Rajotte Date: Mon, 22 Feb 2021 22:20:31 +0000 (-0500) Subject: jjb: tools: add post-build action to gather tap logs X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f6baccc6ce7bedb4a34cfc81c6bb5ea05c2a6640;p=lttng-ci.git jjb: tools: add post-build action to gather tap logs 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 --- diff --git a/jobs/lttng-tools.yaml b/jobs/lttng-tools.yaml index 70cbcde..8260af6 100644 --- a/jobs/lttng-tools.yaml +++ b/jobs/lttng-tools.yaml @@ -484,6 +484,15 @@ - lttng-tools_build_publishers_dev: <tng-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: @@ -542,6 +551,15 @@ - lttng-tools_build_publishers_prod: <tng-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: @@ -764,6 +782,15 @@ <<: *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: @@ -906,6 +933,15 @@ !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 index 0000000..07bbaa4 --- /dev/null +++ b/scripts/lttng-tools/tap_aborted.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright (C) 2021 Jonathan Rajotte-Julien +# +# 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 . + +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