Repository navigation
test: fail the test run when coverage of src/ drops - #91
Merged
Merged
Conversation
Coverage is measured on every pnpm test run. The thresholds start at today's numbers and vitest raises them whenever a run beats them; the aim is 100%. Entry points (scripts/, src/index.ts) run as their own process, which coverage can't see, so they are left out. The Import logic moves from scripts/crates-import.ts into src/ so that it is measured, and its test calls it in-process.
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.
Summary
pnpm testnow measures coverage ofsrc/and fails when it drops below the thresholds invitest.config.ts. Vitest raises the thresholds itself whenever a run beats them; the aim is 100%. Decided in "Test strategy for the indexer" (#89).Entry points run as their own
nodeprocess, which coverage can't see. They are left out, on the rule (now inCLAUDE.md) that they only parse arguments and call code insrc/. Import was the one script holding logic, so it moves:The real
crates:importcommand is still run as a command bytest/bootstrap.test.tsand by theocflStoragetest helper.Evidence
main(ec91b82) oversrc/andscripts/: 89.11% lines, 85.65% branches, 92.6% functions.After: 27 files, 229 tests pass; the starting thresholds, written by the first run:
pnpm lint(biome, knip, tsc) passes.Merge Danger
Door: two-way
Revert the commit, or lower the numbers in
vitest.config.ts.Blast Radius: contributors
src/failspnpm testafter rebasing onto this.vitest.config.tslocally; that change needs committing.src/indexer/; its new folders are to be held at 100% from their first commit (per Test strategy for the indexer #89), which is not part of this change.