diff --git a/.ci/run.sh b/.ci/run.sh index 86f3e4a4b..60f8cf602 100755 --- a/.ci/run.sh +++ b/.ci/run.sh @@ -16,6 +16,23 @@ set -e source /etc/os-release +start_test=$(date '+%Y-%m-%d %H:%M:%S') +last_test=$(date '+%Y-%m-%d %H:%M:%S') + +function cleanup { + if (( "$?" != 0 )); then + echo "<===============================================>" + echo "DEBUG: Logs from all test " + sudo journalctl -t cc-runtime --since="${start_test}" --no-pager + echo "<===============================================>" + echo "<===============================================>" + echo "DEBUG: Logs from last test" + sudo journalctl -t cc-runtime --since="${last_test}" --no-pager + echo "<===============================================>" + fi +} + +trap cleanup EXIT if [ "$ID" == "ubuntu" ] && [ "$VERSION_ID" == "17.04" ]; then export CRIO_STORAGE_DRIVER_OPTS="--storage-driver=devicemapper" @@ -26,5 +43,6 @@ sudo -E PATH="$PATH" bash -c "make check" # Currently, Openshift tests only work on Fedora. # We should delete this condition, when it works for Ubuntu. if [ "$ID" == fedora ]; then + last_test=$(date '+%Y-%m-%d %H:%M:%S') sudo -E PATH="$PATH" bash -c "make openshift" fi