@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
JavaScript
/**
* 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);
});