Skip to content

chore: consolidate 70 integration tests into a single binary#778

Merged
milkyskies merged 1 commit into
mainfrom
optimize-compile
May 31, 2026
Merged

chore: consolidate 70 integration tests into a single binary#778
milkyskies merged 1 commit into
mainfrom
optimize-compile

Conversation

@seito12

@seito12 seito12 commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Move every tests/test_*.rs and tests/scenario_*.rs into tests/cases/ so Cargo treats them as supporting modules instead of separate test binaries.
  • Add tests/integration.rs that 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-run cycle.

Measured impact

cargo test --no-run after editing src/agent/mind/knowledge.rs:

Scenario Before After Delta
Cold rebuild (all test binaries stale) 187s 15.3s -92%
Warm incremental (lib changed) 29s 17.6s -39%

All 372 tests still pass (12 ignored, same as before).

Test plan

  • cargo test -> 372 passed, 0 failed
  • cargo fmt --check
  • Compile-time comparison recorded above
  • CI green

🤖 Generated with Claude Code

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>

@milkyskies milkyskies left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@milkyskies milkyskies merged commit 22922d3 into main May 31, 2026
2 checks passed
@milkyskies milkyskies deleted the optimize-compile branch May 31, 2026 05:38
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