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:
Achilleas Koutsou 2022-05-24 19:02:31 +02:00
parent 3667766661
commit cd49c932a2
11 changed files with 12 additions and 2 deletions

View file

@ -323,6 +323,7 @@ function dump_db() {
WORKDIR=$(mktemp -d)
KILL_PIDS=()
function cleanup() {
greenprint "== Script execution stopped or finished - Cleaning up =="
set +eu
case $CLOUD_PROVIDER in
"$CLOUD_PROVIDER_AWS")
@ -1188,7 +1189,7 @@ function verifyDisk() {
infofile="${filename}-info.json"
sudo /usr/libexec/osbuild-composer-test/image-info "${filename}" | tee "${infofile}" > /dev/null
# save image info to artifacts
cp -v "${infofile}" "${ARTIFACTS}/image-info.json"