Testing Strategy
Relevant source files
The following files were used as context for generating this wiki page:
The Testing Strategy for the WIREDUP project focuses on ensuring the reliability and integrity of a multi-language (Python and Rust) ecosystem. The strategy encompasses unit testing for core dependency injection logic, integration testing for Model Context Protocol (MCP) communication, and validation of agent-based skill execution. It aims to verify that the "Auto-Wiring" engine correctly resolves dependencies while maintaining secure SSH connections and environment configurations.
Testing is distributed across two primary domains: the Python-based AI Auto-Wiring system and the Rust-based NexTerm terminal. This ensures that the bridge between the high-level AI orchestration and the low-level terminal execution remains robust and production-ready.
Sources: README.md:1-20, DEPLOYMENT_STATUS.md:110-125, rust-terminal/BUILD.md:1-20
Core Component Testing
The testing suite targets the fundamental pillars of the architecture, specifically the AutoWire engine, EnvManager, and MCPProtocol.
Dependency Injection (AutoWire)
Testing for the AutoWire system ensures that service registration and resolution adhere to specified scopes and handle complex relationship graphs.
- Scope Verification: Tests confirm that
Scope.SINGLETONreturns the same instance across multiple resolutions, whileScope.TRANSIENTprovides fresh instances. - Error Handling: The system is tested against
CircularDependencyErrorfor recursive relationships andDependencyNotFoundErrorfor missing service registrations.
Sources: tests/test_autowire.py:12-65
Environment and Configuration
The EnvManager is validated for its ability to load, convert, and validate configuration data.
| Test Case | Description | Validated Logic |
|---|---|---|
| Config Loading | Validates setting and getting keys | env_manager.set() / get() |
| Type Conversion | Ensures strings convert to native types | get_int(), get_bool(), get_list() |
| Rule Validation | Checks constraints (e.g., Port ranges) | ValidationType.PORT, min_value, max_value |
Sources: tests/test_autowire.py:68-100
Agent and Skill Validation
The strategy for testing AI agents and their capabilities involves both isolated unit tests for discrete skills and orchestration tests for complex behaviors.
Skill Unit Testing
Skills are tested as discrete, reusable components. Each test creates a SkillContext to simulate a session and verifies the execute method's output.
Sources: SKILLS.md:465-485
Sources: SKILLS.md:470-482
Multi-Agent Coordination
Integration tests for agents verify the flow of data between the agent, the MCPProtocol, and the AgentContext. This includes validating that agents can use injected skills (like search or analysis) to complete a high-level task.
Sources: AGENT.md:330-355, tests/test_autowire.py:155-175
Rust Terminal (NexTerm) Testing
The Rust component utilizes standard Cargo testing utilities to verify the terminal engine, command parser, and Python bridge.
- Test Commands:
cargo testexecutes the full suite, whilecargo test -- --nocaptureallows for debugging output. - Integration Points: Specific focus is placed on the
autowire_bridge.rsto ensure that environment variables likeNEXTERM_AUTOWIRE=truecorrectly trigger the Python interop logic.
Testing Commands Table
| Command | Purpose |
|---|---|
cargo test | Runs all unit and integration tests |
cargo test <test_name> | Runs a specific targeted test |
cargo bench | Performs performance benchmarking on terminal rendering |
Sources: rust-terminal/BUILD.md:22-32, rust-terminal/README.md:195-205
Full-Stack Integration
Integration testing ensures that the Python backend and the communication protocols function as a unified system.
This diagram represents the integration test found in tests/test_autowire.py (lines 180-218), where a BaseAgent subclass is registered via AutoWire with an injected MCPProtocol instance and successfully processes a task.
Sources: tests/test_autowire.py:182-218
The project's testing strategy effectively combines low-level unit verification of dependency injection and environment handling with high-level integration testing of AI agents and terminal interop, ensuring a stable foundation for the WIREDUP infrastructure.