Skip to content

fix(ci): use JSON coverage export instead of fragile text parsing#7

Merged
balloob merged 1 commit intoSendspin:mainfrom
teancom:fix/ci-coverage
Apr 15, 2026
Merged

fix(ci): use JSON coverage export instead of fragile text parsing#7
balloob merged 1 commit intoSendspin:mainfrom
teancom:fix/ci-coverage

Conversation

@teancom
Copy link
Copy Markdown
Contributor

@teancom teancom commented Apr 15, 2026

The previous approach parsed llvm-cov's text table with awk to extract coverage percentages. This broke because $NF (last field) picked up the branch coverage column which is "-" when no branches exist, causing bc to fail with "bad expression".

Replace with llvm-cov export -format=text -summary-only which produces structured JSON. Coverage percentages are extracted with python3 from data[0].totals.lines.percent — no awk, no column counting, no fragility across toolchain versions.

Also refactors the workflow to locate the test binary and profdata once in a dedicated step, avoiding repeated find commands across steps.

The previous approach parsed llvm-cov's text table with awk to extract
coverage percentages. This broke because $NF (last field) picked up the
branch coverage column which is "-" when no branches exist, causing bc
to fail with "bad expression".

Replace with llvm-cov export -format=text -summary-only which produces
structured JSON. Coverage percentages are extracted with python3 from
data[0].totals.lines.percent — no awk, no column counting, no fragility
across toolchain versions.

Also refactors the workflow to locate the test binary and profdata once
in a dedicated step, avoiding repeated find commands across steps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@balloob balloob merged commit 850fb78 into Sendspin:main Apr 15, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants