Skip to content

compute: move long test modules out of line - #38394

Open
antiguru wants to merge 1 commit into
mainfrom
mh/compute-agents-tests
Open

compute: move long test modules out of line#38394
antiguru wants to merge 1 commit into
mainfrom
mh/compute-agents-tests

Conversation

@antiguru

Copy link
Copy Markdown
Member

Several modules in mz-compute carry test modules many times the size of the production code they cover, so the code has to be scrolled past to read. src/cluster-controller already uses the out-of-line pattern, where #[cfg(test)] mod tests; points at a sibling tests.rs. This records that as the crate convention, with a threshold so it is decidable rather than a matter of taste.

Out-of-line tests still reach private items through super::, so moving a module needs no visibility changes.

Worth landing before #38386 and the seven PRs stacked on it, which follow this rule and between them move about 5,900 lines of in-file test modules out of line.

Several modules in `mz-compute` carry test modules many times the size of the
production code they cover, so the file has to be scrolled past to read the
code. The repository already has the out-of-line pattern in
`src/cluster-controller`, where `#[cfg(test)] mod tests;` points at a sibling
`tests.rs`. Record that as the convention for this crate, with a concrete
threshold so it is decidable rather than a matter of taste.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antiguru
antiguru requested a review from a team as a code owner August 21, 2026 10:59
@antiguru
antiguru requested a review from DAlperin August 21, 2026 16:08
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