Skip to main content
Glama
run-all-tests.tsโ€ข6.87 kB
#!/usr/bin/env node /** * MeshSeeks Test Runner * * Comprehensive test runner for all MeshSeeks test suites including * unit tests, integration tests, error handling, and performance tests. * * @author Claude Code * @version 1.0.0 */ import { MeshCoordinatorTestSuite } from './mesh-coordinator.test.js'; import { MeshServerIntegrationTestSuite } from './mesh-server.integration.test.js'; import { MeshErrorHandlingTestSuite } from './mesh-error-handling.test.js'; import { MeshPerformanceTestSuite } from './mesh-performance.test.js'; import { performance } from 'perf_hooks'; interface TestSuiteResult { name: string; success: boolean; duration: number; error?: string; } class MeshSeeksTestRunner { private results: TestSuiteResult[] = []; private startTime: number = 0; async runUnitTests(): Promise<TestSuiteResult> { console.log('๐Ÿ”ง Running Unit Tests...'); const startTime = performance.now(); try { const testSuite = new MeshCoordinatorTestSuite(); await testSuite.runAllTests(); const endTime = performance.now(); return { name: 'Unit Tests', success: true, duration: endTime - startTime }; } catch (error) { const endTime = performance.now(); return { name: 'Unit Tests', success: false, duration: endTime - startTime, error: error?.toString() }; } } async runIntegrationTests(): Promise<TestSuiteResult> { console.log('๐Ÿ”— Running Integration Tests...'); const startTime = performance.now(); try { const testSuite = new MeshServerIntegrationTestSuite(); await testSuite.runAllTests(); const endTime = performance.now(); return { name: 'Integration Tests', success: true, duration: endTime - startTime }; } catch (error) { const endTime = performance.now(); return { name: 'Integration Tests', success: false, duration: endTime - startTime, error: error?.toString() }; } } async runErrorHandlingTests(): Promise<TestSuiteResult> { console.log('โš ๏ธ Running Error Handling Tests...'); const startTime = performance.now(); try { const testSuite = new MeshErrorHandlingTestSuite(); await testSuite.runAllTests(); const endTime = performance.now(); return { name: 'Error Handling Tests', success: true, duration: endTime - startTime }; } catch (error) { const endTime = performance.now(); return { name: 'Error Handling Tests', success: false, duration: endTime - startTime, error: error?.toString() }; } } async runPerformanceTests(): Promise<TestSuiteResult> { console.log('๐Ÿš€ Running Performance Tests...'); const startTime = performance.now(); try { const testSuite = new MeshPerformanceTestSuite(); await testSuite.runAllTests(); const endTime = performance.now(); return { name: 'Performance Tests', success: true, duration: endTime - startTime }; } catch (error) { const endTime = performance.now(); return { name: 'Performance Tests', success: false, duration: endTime - startTime, error: error?.toString() }; } } private generateTestReport(): void { const totalDuration = performance.now() - this.startTime; const passedTests = this.results.filter(r => r.success).length; const failedTests = this.results.filter(r => !r.success).length; console.log('\n' + 'โ•'.repeat(70)); console.log('๐Ÿงช MESHSEEKS COMPREHENSIVE TEST RESULTS'); console.log('โ•'.repeat(70)); console.log('\n๐Ÿ“‹ Test Suite Results:'); for (const result of this.results) { const status = result.success ? 'โœ… PASS' : 'โŒ FAIL'; const duration = (result.duration / 1000).toFixed(2); console.log(` ${status} ${result.name.padEnd(25)} (${duration}s)`); if (!result.success && result.error) { console.log(` Error: ${result.error.split('\n')[0]}`); } } console.log('\n๐Ÿ“Š Summary:'); console.log(` Total Test Suites: ${this.results.length}`); console.log(` โœ… Passed: ${passedTests}`); console.log(` โŒ Failed: ${failedTests}`); console.log(` ๐Ÿ• Total Duration: ${(totalDuration / 1000).toFixed(2)}s`); const successRate = (passedTests / this.results.length) * 100; console.log(` ๐Ÿ“ˆ Success Rate: ${successRate.toFixed(1)}%`); console.log('\n๐Ÿ” Test Coverage Areas:'); console.log(' โœ… Unit Testing - Core coordinator functionality'); console.log(' โœ… Integration Testing - MCP server and tools'); console.log(' โœ… Error Handling - Edge cases and failure scenarios'); console.log(' โœ… Performance Testing - Scalability and efficiency'); const overallSuccess = failedTests === 0; console.log(`\n๐Ÿ† Overall Result: ${overallSuccess ? 'โœ… ALL TESTS PASSED' : 'โŒ SOME TESTS FAILED'}`); if (overallSuccess) { console.log('\n๐ŸŽ‰ MeshSeeks is ready for production use!'); console.log(' - All core functionality tested and validated'); console.log(' - Error handling is robust and comprehensive'); console.log(' - Performance meets all targets'); console.log(' - Integration with MCP servers working correctly'); } else { console.log('\nโš ๏ธ Please address the failed tests before production deployment.'); } } async runAllTestSuites(): Promise<void> { console.log('๐ŸŒ MESHSEEKS COMPREHENSIVE TEST SUITE'); console.log('Testing multi-agent mesh coordination system\n'); this.startTime = performance.now(); try { // Run all test suites in sequence this.results.push(await this.runUnitTests()); console.log(''); // Add spacing between test suites this.results.push(await this.runIntegrationTests()); console.log(''); this.results.push(await this.runErrorHandlingTests()); console.log(''); this.results.push(await this.runPerformanceTests()); console.log(''); // Generate comprehensive report this.generateTestReport(); // Exit with appropriate code const hasFailures = this.results.some(r => !r.success); process.exit(hasFailures ? 1 : 0); } catch (error) { console.error(`โŒ Test runner error: ${error}`); process.exit(1); } } } // Main execution if (import.meta.url === `file://${process.argv[1]}`) { const testRunner = new MeshSeeksTestRunner(); testRunner.runAllTestSuites().catch(console.error); } export { MeshSeeksTestRunner };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/twalichiewicz/meshseeks'

If you have feedback or need assistance with the MCP directory API, please join our Discord server