Repository navigation
ci: report coverage on each pr, and drop tests other tests already cover - #4
Merged
Merged
Conversation
bunfig.toml has every test run report how much of src/ it ran, as a table and as coverage/lcov.info. CI keeps the table from bun run check, shows it in the job summary, and keeps one comment on the pull request up to date with it.
Each test ran alone to see which src lines it reaches. 45 of 121 reach none that the rest do not, within half a point of line coverage. They go, with the imports and helpers only they used. Kept whatever their lines: tests of credentials and tokens, local execution, approvals and answers, refusals and unconfirmed sends, the real terminal tests, and two tests that fail when run alone.
Coverage |
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.
Purpose
Coverage.
bunfig.tomlturns on Bun's built-in coverage for every test run. It prints a table and writescoverage/lcov.info, and skipstests/. CI saves the table frombun run check, adds it to the job summary, and keeps a single comment on each PR up to date with it. Bun reports functions and lines only, with no branch coverage.Drop tests other tests already cover. Each of the 121 tests ran alone to record which
src/lines it reaches. A greedy pass then removed the tests whose lines the remaining tests also reach, within a half-point line-coverage budget. 45 tests go, along with the imports and helpers only they used.main)The budget only counted lines, so function coverage falls further, by 2 points.
Kept regardless of coverage:
Removed: mostly rendering, streaming, history paging and settings tests whose lines other tests also reach, such as the inbox labels, roster ordering, transcript ordering and reconnect replay. Their specific assertions are lost even though the lines still run.
Found while measuring:
names authors from members and closes with EnterthrowsTheme not initialized.reopening keeps every message, including ones sent mid-turngets different entries.main, one full run out of four had a test failure.Verification
All with Bun 1.4.2 from the Nix shell:
bun run checkpasses: Biome, ESLint,tsc, 76 of 76 tests, and the build.main.grepextracts exactly the table frombun run check's output.tsc --noUnusedLocalsshows nothing newly unused. The one remaining hit,inputintests/interactions.test.ts, was already unused onmain.