Repository navigation
test(coverage): bring btree, persistent_facts and index.rs to 90% branches (#396) - #584
Merged
Merged
Conversation
…nches (#396) New tests: leaf packing retried around one large entry, an entry larger than a page (INT-049), separators over the fill target, cow_insert into a root that points to itself (INT-049), auto-save on drop, a torn first meta with a blank page 1, and an unreadable page past the meta's page count. write_internal_pieces splits in one pass: its retry loop could not run, since the balanced cut keeps each node's separators within total / parts <= PAGE_FILL_BYTES - body. check_sorted zips instead of matching windows; test asserts no longer short-circuit. Floors: btree.rs 96/94, persistent_facts.rs 96/90, index.rs 100/100. The workflow pins cargo-llvm-cov 0.9.1: 0.8.x misses the lib test binary under the pinned nightly's build-dir layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U611mBGbkSqJeSwNz2xd7s
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Follow-up to #522: brings the storage files #396 names to its 90% branch target. Closes #396.
src/storage/btree.rssrc/storage/persistent_facts.rssrc/storage/index.rswal.rs(95%) andpacked_pages.rs(100%) were already above it.Tests
pack_leavesretried around one large last entry (an empty group and an overfull leaf on the first cut), and an entry larger than a page (INT-049).build_btreewith separators overPAGE_FILL_BYTES(internal nodes of two children).cow_insertinto a root whose rightmost child is itself: INT-049 from the depth check. The existing cycle test now asserts INT-049 too.assert_tree_exact.PersistentFactStoragesaves it.page_count(a sparse store's hole) is not taken as evidence of a later generation.Code changes
write_internal_piecessplits in one pass. The retry loop could not run: a cut goes before the first element whose running size passes the group's share, so the separators each node keeps add up to at mosttotal / parts, andpartskeeps that withinPAGE_FILL_BYTES - body. An INT-049 check remains for the invariant.check_sortedzips adjacent entries instead of matchingwindows(2), which removes a pattern branch that could not fail.&&(the never-taken failure side counted as uncovered), and helpers drop guards thatread_chain(0, …)already handles.CI
coverage-gates.ymlpinscargo-llvm-cov@0.9.1. It used@latest, and 0.8.5 under the pinned nightly reports far lower numbers (persistent_facts.rs59% branches) because it misses the lib test binary in the new build-dir layout.coverage-thresholds.tomlnow lists the branches left uncovered on purpose: the INT-049 invariant checks,let … elseon groups that are never empty, and the depth check in the test-onlycollect_leaf_pages.Measured locally with nightly-2026-10-01 and cargo-llvm-cov 0.9.1, matching CI's numbers on
v3before the change. 1,463 passing and 10 ignored tests (+6).🤖 Generated with Claude Code
https://claude.ai/code/session_01U611mBGbkSqJeSwNz2xd7s