Report test coverage in the CI run summary - #46
Merged
Conversation
`npm test` runs `node --test` with no coverage flags, so seeing coverage meant passing `--experimental-test-coverage` by hand. A separate `Test coverage` job now posts the report to the run summary and uploads `coverage/lcov.info` as an artifact, following the same shape as vision-download. There's no threshold — coverage is reported, not enforced. Node's built-in coverage plus the `lcov` reporter keep this dependency-free. `set -o pipefail` is load-bearing in that step: `npm run test:coverage | tee` otherwise returns tee's exit status, so the job would pass on a failing suite. `pretest:coverage` creates `coverage/` because the lcov reporter exits rather than creating it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
npm testrunsnode --testwith no coverage flags, so seeing coverage meant passing--experimental-test-coverageby hand. This adds a separateTest coveragejob that posts the report to the run summary and uploadscoverage/lcov.infoas acoverageartifact — the same shape as the job in vision-download: https://github.com/TRUEPIC/vision-download/actions/runs/33080309557No thresholds. Coverage is reported, not enforced.
It uses Node's built-in
--experimental-test-coveragewith thelcovreporter rather than nyc or c8, so nothing new is added to the dependency tree. The job runs once on 26.x instead of across the 22/24/26 matrix, so the run gets one summary rather than three; the existingLint & testjob is untouched.Two things in the diff that look incidental but aren't:
set -o pipefailin the reporting step —npm run test:coverage | teereturns tee's exit status, not npm's. I checked with a deliberately failing test: exit 0 without it, exit 1 with it. Without that line the coverage job reports green on a broken suite.pretest:coverage— the lcov reporter won't create its destination directory, it exits 7 on a missingcoverage/. The pre-hook does themkdirSyncrather than a shellmkdir -p, so it stays portable.Rendered summary looks like this:
🤖 Generated with Claude Code