coverage: survive a truncated raw profile

The merge step takes --failure-mode=all, so a raw profile left short by
a killed process is warned about and skipped instead of aborting the
report. Tests SIGKILL their servers in cleanup traps, and a process
killed while writing its profile leaves a corrupt header behind. The
step still fails when no profile can be read at all.
pull/1252/head
John Safranek 2026-09-14 11:28:19 -07:00 committed by Paul Adelsbach
parent 65802d438c
commit 399c83b1b6
1 changed files with 6 additions and 1 deletions

View File

@ -99,9 +99,14 @@ jobs:
./run_all_sshd_tests.sh
sudo chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE/prof"
# A server SIGKILLed by a test's cleanup trap can leave a truncated
# raw profile behind, and the default --failure-mode=any makes that
# one file fatal to the merge. 'all' keeps it a warning while still
# failing when nothing usable ran.
- name: Report coverage
run: |
llvm-profdata-18 merge -sparse prof/*.profraw -o wolfssh.profdata
llvm-profdata-18 merge -sparse --failure-mode=all \
prof/*.profraw -o wolfssh.profdata
# llvm-cov takes one binary positionally and the rest via -object.
# Programs linking the shared library are libtool wrapper scripts, so
# take the real binary from .libs when one is there. The apps are