Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(testing-strategy): clarify Rust unit test file locations

Steven Enamakel475a4341f534
diff --git a/gitbooks/developing/testing-strategy.md b/gitbooks/developing/testing-strategy.md
index 0e0638dec1..7abcaef064 100644
--- a/gitbooks/developing/testing-strategy.md
+++ b/gitbooks/developing/testing-strategy.md
@@ -13,7 +13,7 @@ How OpenHuman tests its product. Source of truth for "where does my test go?". C
| Layer | Where it lives | What it tests | Driver |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
-| **Rust unit** | Sibling `<module>_tests.rs` files beside the module under `crates/openhuman-core/src/<domain>/` (inline `#[cfg(test)] mod` blocks and files named `tests.rs`/`test.rs` fail `pnpm rust:layout`) | Pure domain logic, schemas, RPC handler shape, in-memory state machines | `cargo test` |
+| **Rust unit** | Sibling `<module>_tests.rs` files beside the module under `crates/openhuman-core/src/<domain>/`, or a `tests/` subdir under a domain (e.g. `crates/openhuman-core/src/channels/tests/`); inline `#[cfg(test)] mod` blocks and files named `tests.rs`/`test.rs` fail `pnpm rust:layout` | Pure domain logic, schemas, RPC handler shape, in-memory state machines | `cargo test` |
| **Rust integration** | `tests/*.rs` at repo root, each an explicit `[[test]]` target in `crates/openhuman-core/Cargo.toml` (`autotests = false`); `tests/raw_coverage/*.rs` is globbed by `build.rs` into the single `raw_coverage_all` target | Full domain wiring with real Tokio runtime, mock external services, JSON-RPC end-to-end (`tests/json_rpc_e2e.rs`), domain × domain interactions | `pnpm test:rust` (which calls `bash scripts/test-rust-with-mock.sh`) |
| **Vitest unit** | Co-located as `*.test.ts(x)` next to source under `app/src/**`, or under `app/src/**/__tests__/` | React components, hooks, store slices, pure utilities, service-layer adapters | `pnpm test:unit` |
| **WDIO E2E** | `app/test/e2e/specs/*.spec.ts` | Full desktop flow: UI → Tauri → in-process core → JSON-RPC; user-visible behaviour | All platforms: Linux CI drives the Wry-based debug build (macOS/Windows desktop E2E is disabled until a native driver lands, #5485). See [E2E Testing](e2e-testing.md). |