torrust_tracker_deployer_lib/application/command_handlers/test/mod.rs
1//! Test Command Module
2//!
3//! This module implements the delivery-agnostic `TestCommandHandler`
4//! for orchestrating infrastructure validation business logic.
5//!
6//! ## Architecture
7//!
8//! The `TestCommandHandler` implements the Command Pattern and uses Dependency Injection
9//! to interact with infrastructure services through interfaces:
10//!
11//! - **Repository Pattern**: Loads environment state via `EnvironmentRepository`
12//! - **Domain-Driven Design**: Uses domain objects from `domain::environment`
13//!
14//! ## Design Principles
15//!
16//! - **Delivery-Agnostic**: Works with CLI, REST API, or any delivery mechanism
17//! - **Asynchronous**: Uses async/await for network operations
18//! - **Runtime State Validation**: Accepts any environment state, validates at runtime
19//! - **Explicit Errors**: All errors implement helpful error messages with actionable guidance
20//!
21//! ## Validation Workflow
22//!
23//! The command handler orchestrates a multi-step validation workflow:
24//!
25//! 1. **Validate cloud-init completion** - Ensure system initialization is complete
26//! 2. **Validate Docker installation** - Verify Docker is installed and running
27//! 3. **Validate Docker Compose installation** - Verify Docker Compose is available
28//!
29//! ## State Management
30//!
31//! Unlike `provision` and `configure` handlers, the test handler does not transition
32//! environment state. It accepts an environment name, loads the environment from storage,
33//! and performs runtime validation checks regardless of the environment's compile-time state.
34
35pub mod errors;
36pub mod handler;
37pub mod result;
38
39#[cfg(test)]
40mod tests;
41
42// Re-export main types for convenience
43pub use errors::TestCommandHandlerError;
44pub use handler::TestCommandHandler;
45pub use result::TestResult;