Skip to content

Commit

Permalink
tests.e2e: Log an error message after unsuccessful run
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ldoktor committed Jan 31, 2024
1 parent 62d67be commit 5d4895d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/e2e/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d4895d

Please sign in to comment.