From 6cbc4a69051f651ec2fe9c0e6d9a7b3dd8906a2d Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Mon, 27 Nov 2017 17:18:56 +0000 Subject: [PATCH] ci: Make sure we save gtdr test results on failures If a test fails, we immediately exit and thus never get a chance to actually upload the test results. Add a trap so that they always uploaded, even on failure. Closes: #1350 Approved by: cgwalters --- ci/build-check.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/ci/build-check.sh b/ci/build-check.sh index 2f4ddaba..6e8b3930 100755 --- a/ci/build-check.sh +++ b/ci/build-check.sh @@ -16,6 +16,17 @@ for x in test-suite.log config.log; do done # And now run the installed tests make install + +copy_out_gdtr_artifacts() { + # Keep this in sync with papr.yml + # TODO; Split the main/clang builds into separate build dirs + for x in test-suite.log config.log gdtr-results; do + if test -e ${resultsdir}/${x}; then + mv ${resultsdir}/${x} ${topdir} + fi + done +} + if test -x /usr/bin/gnome-desktop-testing-runner; then mkdir ${resultsdir}/gdtr-results # Temporary hack @@ -24,6 +35,8 @@ if test -x /usr/bin/gnome-desktop-testing-runner; then env NOCONFIGURE=1 ./autogen.sh ./configure --prefix=/usr --libdir=/usr/lib64 make && rm -f /usr/bin/ginsttest-runner && make install) + # set a trap in case a test fails + trap copy_out_gdtr_artifacts EXIT # Use the new -L option gnome-desktop-testing-runner -L ${resultsdir}/gdtr-results -p 0 ${INSTALLED_TESTS_PATTERN:-libostree/} fi @@ -38,11 +51,3 @@ if test -x /usr/bin/clang; then export CC=clang build fi - -# Keep this in sync with papr.yml -# TODO; Split the main/clang builds into separate build dirs -for x in test-suite.log config.log gdtr-results; do - if test -e ${resultsdir}/${x}; then - mv ${resultsdir}/${x} ${topdir} - fi -done