test(e2e): print combined total across serial and parallel groups
This commit is contained in:
@@ -41,4 +41,21 @@ node --test --test-concurrency="$JOBS" --test-reporter=spec "${E2E_PARALLEL[@]}"
|
||||
> run/logs/e2e-parallel.log 2>&1 || rc=$?
|
||||
cat run/logs/e2e-serial.log run/logs/e2e-parallel.log > results/e2e.log
|
||||
cat results/e2e.log
|
||||
# Each group's spec reporter ends with its own summary. Print one combined line so a reader (or an
|
||||
# agent) cannot mistake the parallel group's "N pass" for the suite total; it is the last line of
|
||||
# results/e2e.log too. Field names are matched from the end so the leading "ℹ" is irrelevant.
|
||||
summary_field() { # <tests|pass|fail|skipped> <log>
|
||||
awk -v k="$1" 'NF >= 2 && $(NF-1) == k && $NF ~ /^[0-9]+$/ { v = $NF } END { print v + 0 }' "$2"
|
||||
}
|
||||
S_TESTS=$(summary_field tests run/logs/e2e-serial.log)
|
||||
S_PASS=$(summary_field pass run/logs/e2e-serial.log)
|
||||
S_FAIL=$(summary_field fail run/logs/e2e-serial.log)
|
||||
S_SKIP=$(summary_field skipped run/logs/e2e-serial.log)
|
||||
P_TESTS=$(summary_field tests run/logs/e2e-parallel.log)
|
||||
P_PASS=$(summary_field pass run/logs/e2e-parallel.log)
|
||||
P_FAIL=$(summary_field fail run/logs/e2e-parallel.log)
|
||||
P_SKIP=$(summary_field skipped run/logs/e2e-parallel.log)
|
||||
printf 'e2e total: tests %d / pass %d / fail %d / skip %d (serial %d, parallel %d)\n' \
|
||||
"$((S_TESTS + P_TESTS))" "$((S_PASS + P_PASS))" "$((S_FAIL + P_FAIL))" \
|
||||
"$((S_SKIP + P_SKIP))" "$S_TESTS" "$P_TESTS" | tee -a results/e2e.log
|
||||
[ "${rc:-0}" -eq 0 ] || exit "$rc"
|
||||
|
||||
Reference in New Issue
Block a user