test: add prominent message in test script cleanup functions
When a test script fails in CI, it's often difficult to pinpoint the exact line in the log where the script failed and the cleanup() function (trapped on EXIT) begins. Adding a prominent line (with greenprint where available) at the start of the cleanup function will make reading logs of failed jobs a lot easier.
This commit is contained in:
parent
3667766661
commit
cd49c932a2
11 changed files with 12 additions and 2 deletions
|
|
@ -47,6 +47,7 @@ fi
|
|||
|
||||
TEMPDIR=$(mktemp -d)
|
||||
function cleanup() {
|
||||
greenprint "== Script execution stopped or finished - Cleaning up =="
|
||||
sudo rm -rf "$TEMPDIR"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue