- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6
Closed
Labels
P0Critical Production Issues - Immediate Response RequiredCritical Production Issues - Immediate Response RequiredenhancementNew feature or requestNew feature or requestmandrelMandrel MCP Test Harness related issuesMandrel MCP Test Harness related issuestestingTesting infrastructure and test coverageTesting infrastructure and test coveragetoolingDevelopment tools and scaffoldingDevelopment tools and scaffolding
Milestone
Description
Problem
The CLI framework is in place with proper command structure, but the test command implementation is missing. Users currently see "Test functionality is not yet implemented" when trying to run tests.
Solution
Implement the test command functionality that integrates with the test suite runner to provide a complete CLI testing experience.
Implementation Details
Update Existing CLI Commands:
1. Implement Test Command Handler (crates/mandrel-mcp-th/src/cli/commands.rs)
impl Commands {
    /// Execute test command with proper error handling and output
    pub async fn execute_test(
        &self,
        spec_file: PathBuf,
        output_dir: Option<PathBuf>,
        format: Option<OutputFormat>,
        server_config: Option<PathBuf>,
    ) -> Result<()> {
        // 1. Initialize test suite runner
        // 2. Connect to MCP server
        // 3. Execute test specification
        // 4. Generate and save reports
        // 5. Display summary to user
    }
    
    /// Display test progress and real-time feedback
    fn display_test_progress(&self, result: &TestResult) {
        // Show real-time test execution progress
    }
}2. Enhanced CLI Arguments
#[derive(Args)]
pub struct TestArgs {
    /// Path to test specification file
    pub spec_file: PathBuf,
    
    /// Output directory for test reports
    #[arg(short, long)]
    pub output: Option<PathBuf>,
    
    /// Report format (html, json, junit, markdown)
    #[arg(short, long, default_value = "html")]
    pub format: OutputFormat,
    
    /// Server configuration file
    #[arg(short, long)]
    pub server_config: Option<PathBuf>,
    
    /// Run tests in parallel
    #[arg(short, long)]
    pub parallel: bool,
    
    /// Fail fast on first error
    #[arg(long)]
    pub fail_fast: bool,
    
    /// Verbose output
    #[arg(short, long)]
    pub verbose: bool,
}3. Enhanced Test Output and Progress
- Real-time test progress display
- Colored output for pass/fail status
- Summary statistics
- Report generation and location display
CLI Integration Flow:
- Parse command: moth test spec.yaml --output ./reports --format html
- Initialize runner: Create TestSuiteRunner with configuration
- Execute tests: Run test specification with progress display
- Generate reports: Create output in specified format and location
- Display summary: Show test results and report location
Dependencies:
- Blocks on: Issue Implement test suite runner for YAML specification execution #220 (Test suite runner)
- Uses: Existing CLI framework (crates/mandrel-mcp-th/src/cli/)
- Uses: Existing reporting system (crates/mandrel-mcp-th/src/reporting/)
Test Requirements:
- Integration test with real YAML specification
- CLI argument parsing tests
- Error handling and user feedback tests
- Report generation integration tests
- Progress display tests
Success Criteria:
-  moth test spec.yamlcommand works end-to-end
- Proper error messages for invalid inputs
- Progress display during test execution
- Report generation in specified format and location
- Clean summary output with statistics
- Verbose mode shows detailed test information
Usage Examples:
# Basic test execution
moth test codeprism-python-comprehensive.yaml
# With custom output and format
moth test spec.yaml --output ./reports --format json
# Parallel execution with fail-fast
moth test spec.yaml --parallel --fail-fast
# Verbose output
moth test spec.yaml --verboseTesting:
- Test with actual CodePrism YAML specifications
- Verify all CLI options work correctly
- Test error scenarios (missing files, invalid server config)
- Validate report generation and output formatting
Estimated Effort:
2-3 hours
Priority:
P0 - Makes the CLI actually functional for users
Metadata
Metadata
Assignees
Labels
P0Critical Production Issues - Immediate Response RequiredCritical Production Issues - Immediate Response RequiredenhancementNew feature or requestNew feature or requestmandrelMandrel MCP Test Harness related issuesMandrel MCP Test Harness related issuestestingTesting infrastructure and test coverageTesting infrastructure and test coveragetoolingDevelopment tools and scaffoldingDevelopment tools and scaffolding