Testing
Running tests
Run the full Rust test suite:Test organization
Unit tests
Most unit tests are co-located with the modules they exercise via#[cfg(test)] blocks.
Common places to inspect:
crates/memorose-core/src/engine/tests.rs- module-local
#[cfg(test)]blocks ingraph/,llm/,raft/,worker.rs, and dashboard handlers
Integration tests
Current integration tests live in:crates/memorose-core/tests/integration.rs
Common patterns
Async tests
I/O-heavy tests typically use#[tokio::test].
Temporary directories
Tests that need isolated storage usually build engines against temp directories rather than shared repo state.Mocking external calls
HTTP-bound tests usewiremock in several places, for example in:
crates/memorose-server/src/shard_manager.rscrates/memorose-core/src/llm/openai_tests.rscrates/memorose-core/src/llm/gemini_tests.rs
LLM behavior in tests
There is no current runtime switch inAppConfig like [development].use_mock_llm that the server loader consumes. In practice, tests use explicit mock client implementations inside Rust test code.
Writing new tests
- Put unit tests close to the code they exercise.
- Put cross-module integration tests under
crates/memorose-core/tests/. - Prefer descriptive names such as
test_hybrid_search_with_agent_filter. - Prefer temp directories over shared on-disk paths.
- Avoid real provider calls unless you are explicitly validating provider integration.

