chore: consolidate 70 integration tests into a single binary#778
Merged
Conversation
Each tests/test_*.rs and tests/scenario_*.rs used to compile as its own test binary, so any lib change forced ~70 link steps. Moving them under tests/cases/ (which Cargo treats as supporting modules, not binaries) and declaring them via `#[path = "cases/..."] mod xxx;` in a new tests/integration.rs collapses the suite into one binary. Measured impact (cargo test --no-run after editing agent/mind/knowledge.rs): - Cold rebuild: 187s -> 15.3s (-92%) - Warm incremental: 29s -> 17.6s (-39%) All 372 tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
tests/test_*.rsandtests/scenario_*.rsintotests/cases/so Cargo treats them as supporting modules instead of separate test binaries.tests/integration.rsthat pulls each file in via#[path = "cases/..."] mod ...;, collapsing the suite into one binary.Why
The previous layout produced 70 test binaries. Any lib change forced ~70 separate codegen + link steps even when the test bodies were unchanged. This dominated the
cargo test --no-runcycle.Measured impact
cargo test --no-runafter editingsrc/agent/mind/knowledge.rs:All 372 tests still pass (12 ignored, same as before).
Test plan
cargo test-> 372 passed, 0 failedcargo fmt --check🤖 Generated with Claude Code