diff options
author | 2018-12-31 10:15:43 +0100 | |
---|---|---|
committer | 2018-12-31 10:15:43 +0100 | |
commit | 874e0d015c28cf6cbf11cd74d21b30594d619d6e (patch) | |
tree | c204e98187d60076814903257c3f00116ef9d0be | |
parent | allow tabs in packagelist bugzilla field (diff) | |
download | tatt-874e0d015c28cf6cbf11cd74d21b30594d619d6e.tar.gz tatt-874e0d015c28cf6cbf11cd74d21b30594d619d6e.tar.bz2 tatt-874e0d015c28cf6cbf11cd74d21b30594d619d6e.zip |
collect test logs when tests fail
-rw-r--r-- | templates/tatt_functions.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh index b7e4e05..92db9ba 100644 --- a/templates/tatt_functions.sh +++ b/templates/tatt_functions.sh @@ -28,11 +28,17 @@ function tatt_pkg_error fi CP=${1#=} - BUILDLOG=/var/tmp/portage/${CP}/temp/build.log + BUILDDIR=/var/tmp/portage/${CP} + BUILDLOG=${BUILDDIR}/temp/build.log if [[ -n "${TATT_BUILDLOGDIR}" && -s "${BUILDLOG}" ]]; then LOGNAME=$(mktemp -p "${TATT_BUILDLOGDIR}" "${CP/\//_}_${TATT_TEST_TYPE}_XXXXX") mv "${BUILDLOG}" "${LOGNAME}" echo " log has been saved as ${LOGNAME}" >> "${TATT_REPORTFILE}" + TESTLOGS=($(find ${BUILDDIR}/work -name test-suite.log -o -name testsuite.log -o -name LastTest.log)) + if [ ${#TESTLOGS[@]} -gt 0 ]; then + tar cf ${LOGNAME}.tar ${TESTLOGS[@]} + echo " testsuite logs have been saved as ${LOGNAME}.tar" >> "${TATT_REPORTFILE}" + fi fi } |