Skip to content

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

Merged
antiguru merged 1 commit into
mainfrom
mh/compute-agents-tests
Aug 26, 2026
Merged

compute: move long test modules out of line#38394
antiguru merged 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
@antiguru
antiguru merged commit 67d268c into main Aug 26, 2026
78 checks passed
@antiguru
antiguru deleted the mh/compute-agents-tests branch August 26, 2026 14:50
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.

2 participants