Repository navigation
test: move inline tests into *_tests.rs files - #180
Conversation
Extract each inline `#[cfg(test)] mod` into a sibling `<module>_tests.rs` declared with `#[path]`, and record the rule in the repo guidance. Co-authored-by: Medulla <medulla@tinyhumans.ai>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughRust unit tests across memory graph, people, sync, and tree modules now reside in sibling test files loaded through path-based module declarations. AGENTS.md documents the test-file convention and an externalization script. Production implementations remain unchanged. ChangesRust unit-test externalization
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The PR relocates existing tests and documents their convention; no actionable merge risk remains. It is mergeable subject to routine CI checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
A rabbit files tests beside their code Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16047f3a69
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,60 @@ | |||
| use std::collections::HashMap; | |||
There was a problem hiding this comment.
Start every extracted test file with
use super::*
Reorder the imports here and in status_tests.rs and workspace_tests.rs: these three newly extracted test files begin with standard-library or crate imports instead of use super::*;, contrary to the test-file convention introduced by this commit.
AGENTS.md reference: AGENTS.md:L46-L48
Useful? React with 👍 / 👎.
Tiny Sweeper reviewTiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below. State: Incomplete Review snapshot
Completeness: Incomplete What changedThe review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below. FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Could not review: src/memory/store/kv.rs Before merge
How this fits togetherflowchart LR
n0["pair_distances<br/>changed"]:::changed
n1["count_edges<br/>changed"]:::changed
n2["MemoryConfig"]:::impacted
n3["push"]:::impacted
n0 -->|uses| n2
n0 -->|calls| n3
n1 -->|uses| n2
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
e2e
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: AGENTS.md, src/memory/graph/bfs.rs, src/memory/graph/bfs_tests.rs, src/memory/graph/edge_store.rs, src/memory/graph/edge_store_tests.rs, src/memory/people/address_book.rs, src/memory/people/address_book_tests.rs, src/memory/people/migrations.rs and 27 more.
$0.0124 · 180,152 in / 6,263 out · 0 cached (0%) · flash, ladder/vectors, deepseek/deepseek-v4-flash · 1,264 embedded
tests: $0.0044 · 48,134 in / 605 out · 0 cached (0%) · deepseek/deepseek-v4-flash
description: $0.0037 · 38,357 in / 1,330 out · 0 cached (0%) · deepseek/deepseek-v4-flash
e2e: $0.0021 · 49,966 in / 381 out · 0 cached (0%) · deepseek/deepseek-v4-flash
Changed the intra-doc link for the safety guard from an absolute path to a relative one using `super::safety`, fixing a broken documentation reference that would have failed to resolve in the rendered docs. Auto-committed-on: dragonfly
The doc comment for the KvStore module used a fully qualified path to reference the `safety` guard, but the link is within the same parent module so the shorter form works and avoids a stale reference if the module is ever reorganised. Auto-committed-on: dragonfly
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: src/memory/store/kv.rs.
$0.0125 · 175,484 in / 7,350 out · 1,280 cached (1%) · ladder/vectors, deepseek/deepseek-v4-flash · 1,272 embedded
tests: $0.0020 · 47,406 in / 412 out · 0 cached (0%) · deepseek/deepseek-v4-flash
description: $0.0040 · 37,658 in / 3,834 out · 1,280 cached (3%) · deepseek/deepseek-v4-flash
e2e: $0.0045 · 49,144 in / 394 out · 0 cached (0%) · deepseek/deepseek-v4-flash
Summary
Moves the inline
#[cfg(test)] modblocks into 17 sibling<module>_tests.rsfiles, each declared with#[cfg(test)]+#[path]abovemod tests;, and records the rule inCLAUDE.md/AGENTS.md. The moves are mechanical: bodies are copied verbatim (dedented, rustfmt'd) and the module keeps its place in the tree, souse super::*, privacy and relative paths are unchanged. Produced with OpenHuman'sscripts/externalize-inline-tests.mjs.Related issue
None.
API or behavior changes
None. Test-only code moved; no public API or runtime behavior changes.
Validation
Commands actually run, with their outcome:
cargo fmt --all -- --check(clean)cargo clippy --all-targets --all-features -- -D warnings(left to CI)cargo check --workspace --tests(passes;cargo build/cargo testleft to CI)cargo test --all-features(left to CI)Tests
No tests added or changed; 17 test modules relocated. Existing
test.rs/*_test.rsfiles are not renamed here.Documentation
CLAUDE.md/AGENTS.mdupdated with the*_tests.rsrule.Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the descriptionSummary by CodeRabbit