refactor: extract inline test blocks to dedicated tests modules#4932
Merged
Conversation
bug-ops
enabled auto-merge (squash)
June 6, 2026 14:56
Move the inline #[cfg(test)] blocks out of two oversized files into dedicated test submodules, matching the monolith-refactor convention. - zeph-subagent/src/manager/mod.rs (4118 -> 527 lines): the three top-level test modules move to manager/tests.rs; the main `tests` module is de-indented to file top level, while worktree_predicate_tests and worktree_cleanup_guard_tests become submodules of tests. - zeph-orchestration/src/scheduler/tick.rs (2200 lines) becomes a directory: tick/mod.rs holds production code, tick/tests.rs the tests. Production code is byte-identical in both files; pure mechanical move with no behavior change. All 159 moved tests (113 + 46) still pass. Closes #4924
bug-ops
force-pushed
the
refactor/4924-extract-test-blocks
branch
from
June 6, 2026 14:58
e082356 to
2fa281a
Compare
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
Extracts the inline
#[cfg(test)]blocks from two oversized files into dedicatedtestssubmodules, matching the monolith-refactor convention (#4878, #4914–#4922). The production code in both files was already well-sized — the outsized totals were entirely inline tests.crates/zeph-subagent/src/manager/mod.rscrates/zeph-orchestration/src/scheduler/tick.rstick/mod.rs)Changes
zeph-subagent/src/manager— the three top-level test modules move tomanager/tests.rs. The maintestsmodule is de-indented to file top level (so itssuper::/super::super::paths resolve identically);worktree_predicate_testsandworktree_cleanup_guard_tests(nosuper::usage) become submodules oftests.mod.rsends at#[cfg(test)] mod tests;.zeph-orchestration/src/scheduler/tick.rs— converted to atick/directory:tick/mod.rs(production) +tick/tests.rs.scheduler/mod.rs'smod tick;resolves to the new directory unchanged;tick/tests.rskeepsuse crate::scheduler::tests::*;anduse super::*;. The directory form is used because the repo has no#[path]precedent andscheduler/tests.rsis already taken by the shared-helpers module.Verification
diffagainstHEADon the production line ranges).cargo nextest run -p zeph-subagent -p zeph-orchestration: 770 passed, 0 skipped; nestedmanager::tests::worktree_*modules execute.cargo +nightly fmt --check,cargo clippy -p zeph-subagent -p zeph-orchestration --all-targets -- -D warnings,RUSTFLAGS="-D warnings" cargo check: all clean.No behavior change; pure mechanical move.
Closes #4924