mirror of
https://github.com/ovh/the-bastion.git
synced 2025-09-04 12:04:11 +08:00
chore: tests: also update totalerrors while tests are running
This commit is contained in:
parent
80ade2ba4c
commit
61538ff086
1 changed files with 9 additions and 2 deletions
|
@ -140,15 +140,22 @@ nbfailedgrep=0
|
|||
nbfailedcon=0
|
||||
nbfailedlog=0
|
||||
nbfailedgeneric=0
|
||||
totalerrors=0
|
||||
isbad=0
|
||||
|
||||
start_time=$(date +%s)
|
||||
|
||||
update_totalerrors()
|
||||
{
|
||||
(( totalerrors = nbfailedret + nbfailedgrep + nbfailedcon + nbfailedlog + nbfailedgeneric ))
|
||||
}
|
||||
|
||||
prefix()
|
||||
{
|
||||
local elapsed=$(( $(date +%s) - start_time))
|
||||
local min=$(( elapsed / 60 ))
|
||||
local sec=$(( elapsed - min * 60 ))
|
||||
local totalerrors=$(( nbfailedret + nbfailedgrep + nbfailedcon + nbfailedgeneric ))
|
||||
update_totalerrors
|
||||
if [ "$totalerrors" = 0 ]; then
|
||||
printf "%b%02dm%02d [noerror]" "$TARGET" "$min" "$sec"
|
||||
else
|
||||
|
@ -463,7 +470,7 @@ echo
|
|||
|
||||
set +e
|
||||
set +u
|
||||
(( totalerrors = nbfailedret + nbfailedgrep + nbfailedcon + nbfailedlog + nbfailedgeneric ))
|
||||
update_totalerrors
|
||||
[ $totalerrors -ge 255 ] && totalerrors=254
|
||||
|
||||
rm -rf "$mytmpdir"
|
||||
|
|
Loading…
Add table
Reference in a new issue