Move the inline tests out of the thirteen report files, and pin the test files - #475
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Owner
Author
|
|
…est files
Each `src-tauri/src/reports/*.rs` file held its tests in an inline
`#[cfg(test)] mod tests {}`, so editing a test re-hashed a pinned
production report. Each block moves to a sibling `<stem>_tests.rs`, loaded
with `#[cfg(test)] #[path = "<stem>_tests.rs"] mod tests;`.
Unlike every earlier batch of this extraction, the new test files are pinned.
That departs from the bridge#416 practice of leaving extracted test files
unpinned. (A few older test files, such as `agent_tests.rs`, were already pinned
before that practice.) The gate requires it here:
`REQUIRED_SURFACE_DIRECTORIES` in the compatibility tool requires every file
under `src-tauri/src/reports` to be pinned, and an unpinned `_tests.rs` there
fails `real_tree_has_complete_migration_and_report_surface_coverage`.
Exempting `_tests.rs` from that rule would change what the gate can miss, so
this PR adds the 13 pins and raises `MAX_SURFACE_FILES` from 249 to 262, with
one grouped, named reason beside the constant. Headroom stays zero.
Each parent rebuilds byte-identical to its previous version from the
parent plus its moved child. rustfmt then re-laid out ten of the thirteen
moved files, all except bulk_party_statement_tests.rs,
outstandings_working_paper_tests.rs and schedule_iii_tests.rs. In each, the
string literals are identical. The non-whitespace code tokens are unchanged
except for trailing commas: one dropped in outstandings_working_paper_xlsx_tests.rs,
one in party_ledger_master_xlsx_tests.rs, two in party_statement_pdf_tests.rs,
and one added in trial_balance_store_tests.rs.
Measured against the original base 32ac7d7, the bridge lib test lists are
identical before and after under default (968),
voucher-scan (986), live-calibration-harness (988) and lab-writes (1068).
The 94 moved test attributes are 94 listed tests, and all pass by exact name
under each set.
The pin list gains exactly the 13 test files and loses nothing. The changed
hashes are the 13 parents and tools/bridge-tally-compatibility/src/lib.rs
(the cap and its reason). check-unbounded-reads scans 10 call sites where
master (be757fe) scans 14. It still reports 10 bounded, 0 unbounded and 3
reviewed exceptions, as on master. The scanner skips `_tests.rs` files by name.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lamemustafa
force-pushed
the
refactor/extract-reports-tests
branch
from
September 17, 2026 02:07
875e411 to
a81b055
Compare
Owner
Author
|
Rebased onto be757fe: 249 master pins + 13 = 262, cap 262, resealed with |
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.
Each
src-tauri/src/reports/*.rsfile held its tests in an inline#[cfg(test)] mod tests {}, so editing a test re-hashed a pinnedproduction report. Each block moves to a sibling
<stem>_tests.rs, loadedwith
#[cfg(test)] #[path = "<stem>_tests.rs"] mod tests;.Unlike every earlier batch of this extraction, the new test files are pinned.
That departs from the bridge#416 practice of leaving extracted test files
unpinned. (A few older test files, such as
agent_tests.rs, were already pinnedbefore that practice.) The gate requires it here:
REQUIRED_SURFACE_DIRECTORIESin the compatibility tool requires every fileunder
src-tauri/src/reportsto be pinned, and an unpinned_tests.rstherefails
real_tree_has_complete_migration_and_report_surface_coverage.Exempting
_tests.rsfrom that rule would change what the gate can miss, sothis PR adds the 13 pins and raises
MAX_SURFACE_FILESfrom 249 to 262, withone grouped, named reason beside the constant. Headroom stays zero.
Each parent rebuilds byte-identical to its previous version from the
parent plus its moved child. rustfmt then re-laid out ten of the thirteen
moved files, all except bulk_party_statement_tests.rs,
outstandings_working_paper_tests.rs and schedule_iii_tests.rs. In each, the
string literals are identical. The non-whitespace code tokens are unchanged
except for trailing commas: one dropped in outstandings_working_paper_xlsx_tests.rs,
one in party_ledger_master_xlsx_tests.rs, two in party_statement_pdf_tests.rs,
and one added in trial_balance_store_tests.rs.
Measured against the original base 32ac7d7, the bridge lib test lists are
identical before and after under default (968),
voucher-scan (986), live-calibration-harness (988) and lab-writes (1068).
The 94 moved test attributes are 94 listed tests, and all pass by exact name
under each set.
The pin list gains exactly the 13 test files and loses nothing. The changed
hashes are the 13 parents and tools/bridge-tally-compatibility/src/lib.rs
(the cap and its reason). check-unbounded-reads scans 10 call sites where
master (be757fe) scans 14. It still reports 10 bounded, 0 unbounded and 3
reviewed exceptions, as on master. The scanner skips
_tests.rsfiles by name.Merge order and the cap. Rebased onto be757fe, after #444 (+12 pins, cap 251) and #473 (−2 pins, cap 249). The "Raised ten times" sentence lists this raise after #444's and after the lowering to 249. The pin list is master's 249 plus these 13, so 262, resealed with
--pins-changed.Before the move I grepped every file type for each path. The readers found: the three reviewed report exceptions in
check-unbounded-reads.mjs(production reads, unchanged) and a path-normalisation test string intools/bridge-tally-compatibility/src/lib_tests.rs. Neither reads test content.Local checks run on this commit: CI's three
src-tauriclippy commands, the sevenscripts/check-*.mjsgates, a reseal with--pins-changedand a verify,cargo test -p bridge-tally-compatibility(including the real-tree required-directory test), andadmission_and_egress_files_stay_pinned. The test lists were taken with a forced rebuild proven to compile from this worktree. The reseal used a tool binary built from this worktree and copied out of the shared build directory, so no other worktree's build could replace it between steps.corepack pnpm teston 875e411: posted as a comment.🤖 Generated with Claude Code