Skip to content

feat(coverage): record each measured file's totals in the summaries - #4

Merged
zhaozhaozz merged 1 commit into
mainfrom
board/coverage-file-totals
Sep 23, 2026
Merged

zhaozhaozz merged 1 commit into
mainfrom
board/coverage-file-totals

Conversation

@zhaozhaozz

Copy link
Copy Markdown

Summary

The Node.js and Python coverage summaries (coverage/summary.json, coverage/python/summary.json and every groups/**/summary.json) now include a sources list: each measured source file's repository-relative path and its own totals (lines and branches, plus functions for Node.js), sorted by path.

A dashboard reading these summaries could show totals and directories but not the files inside them. With sources, a directory tree can be expanded down to a single file. The per-file totals come from the same records the summary adds up, so they sum exactly to its totals. Test sources stay excluded.

Verification

  • node --test scripts/coverage-summary.test.mjs scripts/python-coverage-summary.test.mjs scripts/coverage-report.test.mjs scripts/coverage-job-summary.test.mjs: 22 passed.
  • node --test .ci/ci-contract.test.mjs: 11 passed.
  • On the UT coverage data from a recent main run:
    • Node.js: 493 sources whose line totals sum exactly to the summary (94,259 / 129,378).
    • Python: 69 sources.
    • The addition is about 110 KB for Node.js and 13 KB for Python before indentation.

The Node and Python coverage summaries carried only totals, groups and a
file count, so a dashboard could show a directory but never the files in
it. Each summary now lists every measured source with its own line,
branch and (for Node) function totals, sorted by path. They add up to the
summary's totals because they are the same records.
@zhaozhaozz
zhaozhaozz merged commit f150dd8 into main Sep 23, 2026
7 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.

1 participant