From 5d4895d7a173afea73f658bbc7b0dafeda146236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Tue, 30 Jan 2024 16:14:23 +0100 Subject: [PATCH] tests.e2e: Log an error message after unsuccessful run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On test failure we might still execute a cleanup that spils a bunch of text making it not obvious whether the testing passed or failed. Note the return code is already fine, this change is only for the users to better notice things didn't went well. Signed-off-by: Lukáš Doktor --- tests/e2e/run-local.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/e2e/run-local.sh b/tests/e2e/run-local.sh index ae3dd826..17cba136 100755 --- a/tests/e2e/run-local.sh +++ b/tests/e2e/run-local.sh @@ -76,9 +76,12 @@ undo_changes() { } on_exit() { + RET="$?" if [ "$undo" == "true" ]; then + [ "$RET" -ne 0 ] && echo && echo "ERROR: Testing failed with $RET, starting the cleanup..." undo_changes fi + [ "$RET" -ne 0 ] && echo && echo "ERROR: Testing failed with $RET" || echo "INFO: Testing passed" } trap on_exit EXIT