blob: ff17d24462923202a67eadb12ed67a1c28985ad1 [file] [log] [blame]
Klement Sekeraf413bef2017-08-15 07:09:02 +02001#!/bin/bash
2
juraj.linkesf18eb862018-12-03 14:08:07 +01003if [ "$(ls -A ${FAILED_DIR})" ]
Klement Sekeraf413bef2017-08-15 07:09:02 +02004then
Dave Wallace25dc1672017-09-30 01:53:26 -04005 if [ "${COMPRESS_FAILED_TEST_LOGS}" == "yes" ]
6 then
7 echo -n "Compressing files in temporary directories from failed test runs... "
juraj.linkesf18eb862018-12-03 14:08:07 +01008 cd ${FAILED_DIR}
Dave Wallace25dc1672017-09-30 01:53:26 -04009 for d in *
10 do
11 cd ${d}
12 find . ! -path . -print0 | xargs -0 -n1 gzip
juraj.linkesf18eb862018-12-03 14:08:07 +010013 cd ${FAILED_DIR}
Dave Wallace25dc1672017-09-30 01:53:26 -040014 done
15 echo "done."
16 if [ -n "$WORKSPACE" ]
17 then
18 echo "Copying failed test logs into build log archive directory ($WORKSPACE/archives)... "
juraj.linkesf18eb862018-12-03 14:08:07 +010019 for failed_test in $(ls $FAILED_DIR)
Dave Wallace25dc1672017-09-30 01:53:26 -040020 do
21 mkdir -p $WORKSPACE/archives/$failed_test
juraj.linkesf18eb862018-12-03 14:08:07 +010022 cp -a $FAILED_DIR/$failed_test/* $WORKSPACE/archives/$failed_test
Dave Wallace25dc1672017-09-30 01:53:26 -040023 done
24 echo "done."
25 fi
juraj.linkesf18eb862018-12-03 14:08:07 +010026
Dave Wallace25dc1672017-09-30 01:53:26 -040027 else
28 echo "Not compressing files in temporary directories from failed test runs."
29 fi
Klement Sekeraf413bef2017-08-15 07:09:02 +020030else
juraj.linkesf18eb862018-12-03 14:08:07 +010031 echo "No symlinks to failed tests' temporary directories found in ${FAILED_DIR}."
Klement Sekeraf413bef2017-08-15 07:09:02 +020032fi
Dave Wallace25dc1672017-09-30 01:53:26 -040033
34# This script gets run only if there was a 'make test' failure,
35# so return failure error status so that the build results are
36# recorded correctly.
37exit 1