monitoring: global #NNN, progress bar, secrets.env, yellow WARN

This commit is contained in:
Hernâni Marques 2026-07-17 18:19:30 +02:00
parent db90ddcce5
commit 57b4014ccc
No known key found for this signature in database
GPG key ID: CB5738652768F7E9
6 changed files with 144 additions and 25 deletions

View file

@ -404,13 +404,28 @@ TEST_AREA=""
TEST_GROUP=""
TEST_N=0
LAST_TID=""
GLOBAL_N=0
# Global / progress: may continue across check_*.sh processes via TALER_MON_STATE
GLOBAL_N="${GLOBAL_N:-0}"
LAST_GLOBAL=""
# Progress: set_progress_total N (0 = unknown → bar shows done only)
PROGRESS_DONE=0
PROGRESS_DONE="${PROGRESS_DONE:-0}"
PROGRESS_TOTAL="${PROGRESS_TOTAL:-0}"
PROGRESS_SHOW_EVERY="${PROGRESS_SHOW_EVERY:-8}"
PROGRESS_LAST_SHOWN=0
PROGRESS_LAST_SHOWN="${PROGRESS_LAST_SHOWN:-0}"
_mon_state_load() {
[ -n "${TALER_MON_STATE:-}" ] && [ -f "${TALER_MON_STATE}" ] || return 0
# shellcheck disable=SC1090
. "${TALER_MON_STATE}"
}
_mon_state_save() {
[ -n "${TALER_MON_STATE:-}" ] || return 0
{
printf 'GLOBAL_N=%s\n' "$GLOBAL_N"
printf 'PROGRESS_DONE=%s\n' "$PROGRESS_DONE"
printf 'PROGRESS_TOTAL=%s\n' "$PROGRESS_TOTAL"
printf 'PROGRESS_LAST_SHOWN=%s\n' "$PROGRESS_LAST_SHOWN"
} >"${TALER_MON_STATE}"
}
_mon_state_load
# Per-group counters so re-entering www.exchange after perf continues NN
# (shell vars TEST_CNT_<area>_<group>).
_tid_key() {
@ -467,15 +482,20 @@ set_group() {
_progress_maybe_show 1
}
set_progress_total() {
# Optional: expected number of numbered checks in this run (or remaining phase).
# Optional: expected number of numbered checks in this run.
# PROGRESS_TOTAL=0 → no percent, only "done=N".
PROGRESS_TOTAL="${1:-0}"
PROGRESS_DONE=0
PROGRESS_LAST_SHOWN=0
# Does not reset GLOBAL_N / PROGRESS_DONE if already mid-run (state file).
local n="${1:-0}"
PROGRESS_TOTAL="$n"
if [ "${PROGRESS_DONE:-0}" -eq 0 ]; then
PROGRESS_LAST_SHOWN=0
fi
_mon_state_save
}
add_progress_total() {
local n="${1:-0}"
PROGRESS_TOTAL=$((PROGRESS_TOTAL + n))
_mon_state_save
}
_progress_bar_line() {
local done="$1" total="$2" width=24 pct=0 filled empty i bar
@ -534,6 +554,7 @@ _take_tid() {
LAST_TID=$(printf '%s-%02d' "$TEST_AREA" "$TEST_N")
fi
PROGRESS_DONE=$((PROGRESS_DONE + 1))
_mon_state_save
_progress_maybe_show 0
}
# Dim ids: "#003 www.exchange-01 " or empty