This directory contains integration tests, fixtures, and snapshot data for the OMNI Semantic Signal Engine.
tests/
├── fixtures/ # 45 realistic tool output samples
│ ├── git_diff_multi_file.txt
│ ├── cargo_build_errors.txt
│ ├── pytest_failures.txt
│ └── ...
├── savings_assertions.rs # Per-filter savings threshold tests
├── hook_e2e.rs # Binary spawn E2E tests
├── security_tests.rs # Security validation tests
└── smoke_test.sh # Shell smoke test script
# All tests (147 total)
cargo test
# Specific suites
cargo test --test hook_e2e # 10 E2E tests
cargo test --test savings_assertions # 4 savings tests
cargo test --test security_tests # 6 security tests
# Snapshot tests
cargo test distillers::tests
cargo insta review # Review changes
# Smoke tests
chmod +x tests/smoke_test.sh
tests/smoke_test.sh ./target/debug/omni- Save realistic CLI output to
tests/fixtures/my_tool_output.txt - Reference it in a snapshot test or savings assertion
- Run
cargo testto verify
- Issue: Parallel integration tests competing for
~/.omni/omni.dbcause SQLite locks and hangs. - Rule: Never use the default DB path in tests.
- Solution: Use the
omni_cmd()helper intests/hook_e2e.rsto spawn theomnibinary with a uniqueOMNI_DB_PATH(usingtempfile::NamedTempFile).
- Issue: Nested or redundant
lock()calls onsession_arccause deadlocks (Rust Mutexes are not reentrant). - Rule: Lock early, release fast. Do not hold a lock while calling a function that might try to acquire it again.
- Solution: Open a scope
{ ... }for the lock, extract needed data, and let the guard drop before proceeding to other database or processing operations.
- Warning: If
cargo testtakes > 1 minute on MacOS or Linux, a deadlock or resource contention is likely present. - Action: Check
Pipe ModeandE2E testsfirst, as they are the most resource-heavy components.