UNPKG

@versatil/sdlc-framework

Version:

๐Ÿš€ AI-Native SDLC framework with 11-MCP ecosystem, RAG memory, OPERA orchestration, and 6 specialized agents achieving ZERO CONTEXT LOSS. Features complete CI/CD pipeline with 7 GitHub workflows (MCP testing, security scanning, performance benchmarking),

297 lines (267 loc) โ€ข 10.3 kB
#!/usr/bin/env node /** * VERSATIL SDLC Framework - MCP Integration Test * Tests the complete MCP integration with VERSATIL agents */ const { VERSATILMCPClient } = require('../dist/mcp/mcp-client'); const { Logger } = require('../dist/utils/logger'); console.log('๐Ÿ”ง VERSATIL SDLC Framework - MCP Integration Test'); console.log('='.repeat(60)); const logger = new Logger('MCP-Test'); async function testMCPIntegration() { const client = new VERSATILMCPClient(); let testsPassed = 0; let testsTotal = 0; // Test 1: Health Check console.log('\n๐Ÿฅ Test 1: MCP Health Check'); testsTotal++; try { const isHealthy = await client.healthCheck(); if (isHealthy) { console.log(' โœ… MCP Client is healthy and responsive'); testsPassed++; } else { console.log(' โŒ MCP Client health check failed'); } } catch (error) { console.log(` โŒ Health check error: ${error.message}`); } // Test 2: Agent Activation console.log('\n๐Ÿค– Test 2: Agent Activation via MCP'); testsTotal++; try { const agentResponse = await client.executeTool({ tool: 'versatil_activate_agent', arguments: { agentId: 'enhanced-maria', context: { task: 'Code quality review', priority: 'high' } } }); if (agentResponse.success) { console.log(' โœ… Agent activation successful'); console.log(` ๐Ÿ“Š Agent: ${agentResponse.data.agentId}`); console.log(` ๐Ÿ“‹ Status: ${agentResponse.data.status}`); testsPassed++; } else { console.log(` โŒ Agent activation failed: ${agentResponse.error}`); } } catch (error) { console.log(` โŒ Agent activation error: ${error.message}`); } // Test 3: SDLC Orchestration console.log('\n๐Ÿ”„ Test 3: SDLC Orchestration'); testsTotal++; try { const sdlcResponse = await client.executeTool({ tool: 'versatil_orchestrate_sdlc', arguments: { action: 'status' } }); if (sdlcResponse.success) { console.log(' โœ… SDLC orchestration working'); console.log(` ๐Ÿ“Š Current phase: ${sdlcResponse.data.currentPhase || 'Unknown'}`); console.log(` ๐Ÿ“ˆ Completeness: ${sdlcResponse.data.completeness || 'N/A'}%`); testsPassed++; } else { console.log(` โŒ SDLC orchestration failed: ${sdlcResponse.error}`); } } catch (error) { console.log(` โŒ SDLC orchestration error: ${error.message}`); } // Test 4: Quality Gate Execution console.log('\n๐Ÿšฆ Test 4: Quality Gate Execution'); testsTotal++; try { const qualityResponse = await client.executeTool({ tool: 'versatil_quality_gate', arguments: { phase: 'Development', checks: ['unit-tests', 'code-coverage', 'linting'], threshold: 80 } }); if (qualityResponse.success) { console.log(' โœ… Quality gate execution successful'); console.log(` ๐Ÿ“Š Score: ${qualityResponse.data.score}%`); console.log(` ๐ŸŽฏ Threshold: ${qualityResponse.data.threshold}%`); testsPassed++; } else { console.log(` โŒ Quality gate failed: ${qualityResponse.error}`); } } catch (error) { console.log(` โŒ Quality gate error: ${error.message}`); } // Test 5: Test Suite Execution console.log('\n๐Ÿงช Test 5: Test Suite Execution'); testsTotal++; try { const testResponse = await client.executeTool({ tool: 'versatil_test_suite', arguments: { type: 'integration', coverage: true, browser: 'chrome' } }); if (testResponse.success) { console.log(' โœ… Test suite execution successful'); console.log(` ๐Ÿ“Š Tests: ${testResponse.data.tests.passed}/${testResponse.data.tests.total} passed`); console.log(` ๐Ÿ“ˆ Coverage: ${testResponse.data.coverage}%`); console.log(` โฑ๏ธ Duration: ${testResponse.data.duration}s`); testsPassed++; } else { console.log(` โŒ Test suite failed: ${testResponse.error}`); } } catch (error) { console.log(` โŒ Test suite error: ${error.message}`); } // Test 6: Architecture Analysis console.log('\n๐Ÿ—๏ธ Test 6: Architecture Analysis'); testsTotal++; try { const archResponse = await client.executeTool({ tool: 'versatil_architecture_analysis', arguments: { target: 'src/', depth: 'comprehensive', includeRecommendations: true } }); if (archResponse.success) { console.log(' โœ… Architecture analysis successful'); console.log(` ๐Ÿ“Š Maintainability: ${archResponse.data.architecture.maintainability}`); console.log(` ๐Ÿ“ˆ Scalability: ${archResponse.data.architecture.scalability}`); console.log(` ๐Ÿ” Issues found: ${archResponse.data.issues.length}`); testsPassed++; } else { console.log(` โŒ Architecture analysis failed: ${archResponse.error}`); } } catch (error) { console.log(` โŒ Architecture analysis error: ${error.message}`); } // Test 7: Framework Status console.log('\n๐Ÿ“Š Test 7: Framework Status'); testsTotal++; try { const statusResponse = await client.executeTool({ tool: 'versatil_framework_status', arguments: {} }); if (statusResponse.success) { console.log(' โœ… Framework status retrieval successful'); console.log(` ๐Ÿ“Š Version: ${statusResponse.data.framework.version}`); console.log(` ๐Ÿค– Agents: ${statusResponse.data.agents.active}/${statusResponse.data.agents.total} active`); console.log(` ๐ŸŽฏ SDLC Completeness: ${statusResponse.data.sdlc.completeness}%`); console.log(` โšก Performance: ${statusResponse.data.performance.responseTime}`); testsPassed++; } else { console.log(` โŒ Framework status failed: ${statusResponse.error}`); } } catch (error) { console.log(` โŒ Framework status error: ${error.message}`); } // Test 8: File Analysis console.log('\n๐Ÿ“„ Test 8: File Analysis'); testsTotal++; try { const fileResponse = await client.executeTool({ tool: 'versatil_file_analysis', arguments: { filePath: 'src/agents/enhanced-maria.ts', analysisType: 'comprehensive' } }); if (fileResponse.success) { console.log(' โœ… File analysis successful'); console.log(` ๐Ÿ“Š Complexity: ${fileResponse.data.metrics.complexity}`); console.log(` ๐Ÿ“ˆ Maintainability: ${fileResponse.data.metrics.maintainability}`); console.log(` ๐ŸŽฏ Test Coverage: ${fileResponse.data.metrics.testCoverage}%`); testsPassed++; } else { console.log(` โŒ File analysis failed: ${fileResponse.error}`); } } catch (error) { console.log(` โŒ File analysis error: ${error.message}`); } // Test 9: Performance Report console.log('\n๐Ÿ“ˆ Test 9: Performance Report'); testsTotal++; try { const perfResponse = await client.executeTool({ tool: 'versatil_performance_report', arguments: { reportType: 'summary', timeframe: '24h' } }); if (perfResponse.success) { console.log(' โœ… Performance report generated'); console.log(` ๐Ÿ“Š Agent Activations: ${perfResponse.data.metrics.agentActivations}`); console.log(` โšก Avg Response Time: ${perfResponse.data.metrics.avgResponseTime}`); console.log(` ๐ŸŽฏ Quality Gate Success: ${perfResponse.data.metrics.qualityGateSuccess}%`); testsPassed++; } else { console.log(` โŒ Performance report failed: ${perfResponse.error}`); } } catch (error) { console.log(` โŒ Performance report error: ${error.message}`); } // Test 10: Available Tools Check console.log('\n๐Ÿ› ๏ธ Test 10: Available Tools'); testsTotal++; try { const availableTools = client.getAvailableTools(); if (availableTools.length >= 10) { console.log(' โœ… All MCP tools are available'); console.log(` ๐Ÿ“Š Tool count: ${availableTools.length}`); availableTools.forEach(tool => { console.log(` ๐Ÿ”ง ${tool}`); }); testsPassed++; } else { console.log(` โŒ Missing tools. Expected 10+, found ${availableTools.length}`); } } catch (error) { console.log(` โŒ Available tools error: ${error.message}`); } // Final Results console.log('\n' + '='.repeat(60)); console.log('๐Ÿ† MCP Integration Test Results'); console.log('='.repeat(60)); const successRate = (testsPassed / testsTotal) * 100; console.log(`๐Ÿ“Š Tests Passed: ${testsPassed}/${testsTotal} (${successRate.toFixed(1)}%)`); if (successRate >= 90) { console.log('๐ŸŽ‰ EXCELLENT: MCP integration is fully functional!'); console.log('๐Ÿš€ Ready for AI assistant integration with VERSATIL framework'); } else if (successRate >= 75) { console.log('โœ… GOOD: MCP integration is mostly working'); console.log('๐Ÿ”ง Minor issues to resolve for optimal performance'); } else if (successRate >= 50) { console.log('๐ŸŸก PARTIAL: MCP integration has significant issues'); console.log('๐Ÿ› ๏ธ Major fixes required before production use'); } else { console.log('๐Ÿ”ด CRITICAL: MCP integration is not functional'); console.log('๐Ÿšจ Immediate attention required'); } console.log('\n๐ŸŽฏ Key MCP Capabilities Verified:'); console.log(' โ€ข Agent activation and communication'); console.log(' โ€ข SDLC orchestration and phase management'); console.log(' โ€ข Quality gate execution and validation'); console.log(' โ€ข Test suite execution and reporting'); console.log(' โ€ข Architecture analysis and recommendations'); console.log(' โ€ข Performance monitoring and insights'); console.log(' โ€ข File analysis and intelligent suggestions'); console.log(' โ€ข Framework status and health monitoring'); console.log('\n๐Ÿ“‹ MCP Integration Status: ' + (successRate >= 90 ? 'READY FOR PRODUCTION โœ…' : 'NEEDS OPTIMIZATION ๐Ÿ”ง')); console.log('๐Ÿ”— AI assistants can now interact with VERSATIL via standardized MCP protocol!'); console.log(''); } // Run the test testMCPIntegration().catch(error => { console.error('โŒ MCP Integration test failed:', error); process.exit(1); });