This directory contains comprehensive test templates for all EXO-AI 2025 crates. These templates are ready to be copied into the actual crate directories once the implementation code is written.
test-templates/
├── exo-core/
│ └── tests/
│ └── core_traits_test.rs # Core trait and type tests
├── exo-manifold/
│ └── tests/
│ └── manifold_engine_test.rs # Manifold engine tests
├── exo-hypergraph/
│ └── tests/
│ └── hypergraph_test.rs # Hypergraph substrate tests
├── exo-temporal/
│ └── tests/
│ └── temporal_memory_test.rs # Temporal memory tests
├── exo-federation/
│ └── tests/
│ └── federation_test.rs # Federation and consensus tests
├── exo-backend-classical/
│ └── tests/
│ └── classical_backend_test.rs # ruvector integration tests
├── integration/
│ ├── manifold_hypergraph_test.rs # Cross-crate integration
│ ├── temporal_federation_test.rs # Distributed memory
│ └── full_stack_test.rs # Complete system tests
└── README.md # This file
Once a coder agent creates a crate (e.g., crates/exo-core/), copy the corresponding test template:
# Example for exo-core
cp test-templates/exo-core/tests/core_traits_test.rs \
crates/exo-core/tests/
# Uncomment the use statements and imports
# Remove placeholder comments
# Run tests
cd crates/exo-core
cargo testFor each test file:
- Copy to actual crate directory
- Uncomment
usestatements - Remove placeholder comments
- Add
#[cfg(test)]if not present - Run
cargo testto verify - Fix any compilation errors
- Ensure tests pass or fail appropriately (TDD)
Each crate has tests for:
- ✅ Pattern construction and validation
- ✅ TopologicalQuery variants
- ✅ SubstrateTime operations
- ✅ Error handling
- ✅ Filter types
- ✅ Gradient descent retrieval
- ✅ Manifold deformation
- ✅ Strategic forgetting
- ✅ SIREN network operations
- ✅ Fourier features
- ✅ Tensor Train compression (feature-gated)
- ✅ Edge cases (NaN, infinity, etc.)
- ✅ Hyperedge creation and query
- ✅ Persistent homology (0D, 1D, 2D)
- ✅ Betti numbers
- ✅ Sheaf consistency (feature-gated)
- ✅ Simplicial complex operations
- ✅ Entity and relation indexing
- ✅ Causal cone queries (past, future, light-cone)
- ✅ Memory consolidation
- ✅ Salience computation
- ✅ Anticipatory pre-fetch
- ✅ Causal graph operations
- ✅ Temporal knowledge graph
- ✅ Short-term buffer management
- ✅ Post-quantum key exchange (Kyber)
- ✅ Byzantine fault tolerance
- ✅ CRDT reconciliation
- ✅ Onion routing
- ✅ Federation handshake
- ✅ Raft consensus
- ✅ Encrypted channels
- ✅ ruvector-core integration
- ✅ ruvector-graph integration
- ✅ ruvector-gnn integration
- ✅ SubstrateBackend implementation
- ✅ Performance tests
- ✅ Concurrency tests
Integration tests in integration/ should be placed in crates/tests/ at the workspace root:
# Create workspace integration test directory
mkdir -p crates/tests
# Copy integration tests
cp test-templates/integration/*.rs crates/tests/# Run all tests in workspace
cargo test --all-features
# Run tests for specific crate
cargo test -p exo-manifold
# Run specific test file
cargo test -p exo-manifold --test manifold_engine_test
# Run with coverage
cargo tarpaulin --all-features
# Run integration tests only
cargo test --test '*'
# Run benchmarks
cargo bench- Copy template to crate directory
- Uncomment imports and test code
- Run tests - they will fail (RED)
- Implement code to make tests pass
- Run tests again - they should pass (GREEN)
- Refactor code while keeping tests green
- Repeat for next test
Some tests are feature-gated:
#[test]
#[cfg(feature = "tensor-train")]
fn test_tensor_train_compression() {
// Only runs with --features tensor-train
}
#[test]
#[cfg(feature = "sheaf-consistency")]
fn test_sheaf_consistency() {
// Only runs with --features sheaf-consistency
}
#[test]
#[cfg(feature = "post-quantum")]
fn test_kyber_key_exchange() {
// Only runs with --features post-quantum
}Run with features:
cargo test --features tensor-train
cargo test --all-featuresFederation and temporal tests use tokio::test:
#[tokio::test]
async fn test_async_operation() {
// Async test code
}Ensure tokio is in dev-dependencies:
[dev-dependencies]
tokio = { version = "1.0", features = ["full", "test-util"] }Common test utilities should be placed in:
crates/test-utils/
├── src/
│ ├── fixtures.rs # Test data generators
│ ├── mocks.rs # Mock implementations
│ └── helpers.rs # Test helper functions
Generate coverage reports:
# Install tarpaulin
cargo install cargo-tarpaulin
# Generate coverage
cargo tarpaulin --all-features --out Html --output-dir coverage/
# View report
open coverage/index.htmlTests should be run in CI:
# .github/workflows/test.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --all-features
- run: cargo test --test '*' # Integration tests- Unit Tests: 85%+ statement coverage
- Integration Tests: 70%+ coverage
- E2E Tests: Key user scenarios
| Operation | Target Latency | Target Throughput |
|---|---|---|
| Manifold Retrieve (k=10) | <10ms | >1000 qps |
| Hyperedge Creation | <1ms | >10000 ops/s |
| Causal Query | <20ms | >500 qps |
| Byzantine Commit | <100ms | >100 commits/s |
- ✅ Test strategy created (
docs/TEST_STRATEGY.md) - ✅ Test templates created (this directory)
- ⏳ Wait for coder to create crates
- ⏳ Copy templates to crates
- ⏳ Uncomment and activate tests
- ⏳ Run tests (TDD: RED phase)
- ⏳ Implement code to pass tests
- ⏳ Achieve GREEN phase
- ⏳ Refactor and optimize
- Test Strategy:
../docs/TEST_STRATEGY.md - Architecture:
../architecture/ARCHITECTURE.md - Specification:
../specs/SPECIFICATION.md - Pseudocode:
../architecture/PSEUDOCODE.md
For questions about test implementation:
- Check
docs/TEST_STRATEGY.mdfor comprehensive guidance - Review template files for examples
- Ensure TDD workflow is followed