release 1.13.10: global SUMMARY at end of multi-phase runs

Persist GLOBAL_PASS/FAIL/WARN/INFO/BLOCK in TALER_MON_STATE across
check_*.sh processes. Multi-phase never prints a phase SUMMARY box
(only ERRORS/BLOCKERS mid-run); parent progress_finish + summary_global
prints one whole-run totals stand after all phases.
This commit is contained in:
Hernâni Marques 2026-07-19 04:09:35 +02:00
parent 80638ddea0
commit 40850f1080
No known key found for this signature in database
4 changed files with 139 additions and 73 deletions

View file

@ -570,12 +570,14 @@ chmod +x "$ROOT"/check_*.sh 2>/dev/null || true
ec=0
_phase_idx=0
_n_phases=${#PHASES[@]}
# Suppress mid-run SUMMARY / progress standings when more than one phase
# Suppress all phase SUMMARY / progress standings when more than one phase;
# parent prints one global SUMMARY after progress_finish (v1.13.10+).
if [ "$_n_phases" -gt 1 ]; then
export TALER_MON_MULTI_PHASE=1
else
export TALER_MON_MULTI_PHASE=0
fi
_MON_WAS_MULTI="${TALER_MON_MULTI_PHASE}"
while [ "$_phase_idx" -lt "$_n_phases" ]; do
p="${PHASES[$_phase_idx]}"
if [ "$RUN_TIMED_OUT" = "1" ]; then
@ -591,12 +593,6 @@ while [ "$_phase_idx" -lt "$_n_phases" ]; do
_phase_idx=$((_phase_idx + 1))
continue
fi
# Only last phase may print full SUMMARY + progress standings
if [ "$((_phase_idx + 1))" -ge "$_n_phases" ]; then
export PROGRESS_FINAL=1
else
export PROGRESS_FINAL=0
fi
case "$p" in
urls) run_phase urls "$ROOT/check_urls.sh" || ec=1 ;;
inside) run_phase inside "$ROOT/check_inside.sh" || ec=1 ;;
@ -665,7 +661,7 @@ if [ "$RUN_TIMED_OUT" = "1" ]; then
fi
# Snap progress bar to real global count (done/total) once for the whole run.
# Reload TALER_MON_STATE — check_*.sh update done/total in a separate process.
# Reload TALER_MON_STATE — check_*.sh update done/total + GLOBAL_*_N in a separate process.
if type _mon_state_load >/dev/null 2>&1; then
_mon_state_load
fi
@ -673,5 +669,11 @@ if type progress_finish >/dev/null 2>&1; then
printf '\n'
progress_finish
fi
# Multi-phase: one global SUMMARY (OK/ERROR/WARN/INFO/BLOCK across all phases).
# Single-phase already printed phase-local SUMMARY via check_*.sh.
if [ "${_MON_WAS_MULTI:-0}" = "1" ] && type summary_global >/dev/null 2>&1; then
summary_global || true
fi
unset _MON_WAS_MULTI 2>/dev/null || true
exit "$ec"