1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-10 12:44:15 +00:00

limit logs to errored tests

This commit is contained in:
deadc0de6
2020-10-25 20:49:31 +01:00
parent 00cf2a11a6
commit 4780cb04c2

View File

@@ -25,6 +25,9 @@ which ${nosebin} >/dev/null 2>&1
which ${nosebin} >/dev/null 2>&1 which ${nosebin} >/dev/null 2>&1
[ "$?" != "0" ] && echo "Install nosetests" && exit 1 [ "$?" != "0" ] && echo "Install nosetests" && exit 1
# do not print debugs when running tests (faster)
export DOTDROP_FORCE_NODEBUG=yes
# coverage file location # coverage file location
cur=`dirname $(readlink -f "${0}")` cur=`dirname $(readlink -f "${0}")`
export COVERAGE_FILE="${cur}/.coverage" export COVERAGE_FILE="${cur}/.coverage"
@@ -42,29 +45,33 @@ unset DOTDROP_FORCE_NODEBUG
## execute bash script tests ## execute bash script tests
[ "$1" = '--python-only' ] || { [ "$1" = '--python-only' ] || {
echo "doing extended tests" echo "doing extended tests"
log=`mktemp` logdir=`mktemp -d`
for scr in tests-ng/*.sh; do for scr in tests-ng/*.sh; do
logfile="${logdir}/`basename ${scr}`.log"
echo "-> running test ${scr} (logfile:${logfile})"
if [ -z ${TRAVIS} ]; then if [ -z ${TRAVIS} ]; then
${scr} > "${log}" 2>&1 & ${scr} > "${logfile}" 2>&1 &
#tail --pid="$!" -f "${logfile}"
else else
#${scr} > "${log}" >/dev/null 2>&1 & #${scr} > "${log}" >/dev/null 2>&1 &
${scr} & ${scr} > "${logfile}" 2>&1 &
fi fi
tail --pid="$!" -f "${log}"
set +e set +e
wait "$!" wait "$!"
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "Test ${scr} finished with error" echo "test ${scr} finished with error"
rm -f ${log} rm -rf ${logdir}
exit 1 exit 1
elif grep Traceback ${log}; then elif grep Traceback ${logfile}; then
echo "crash found in logs" echo "test ${scr} crashed"
rm -f ${log} cat ${logfile}
rm -rf ${logdir}
exit 1 exit 1
fi fi
set -e set -e
echo "test ${scr} ok"
done done
rm -f ${log} rm -rf ${logdir}
} }
## test the doc with remark ## test the doc with remark