Skip to main content
Glama

In Memoria

run-comprehensive-tests.jsโ€ข4.35 kB
#!/usr/bin/env node import { execSync } from 'child_process'; import { existsSync } from 'fs'; async function runAllTests() { console.log('๐Ÿงช Running comprehensive test suite for language support changes...\n'); const tests = [ { name: 'Rust Unit Tests', command: 'cd rust-core && cargo test', critical: true }, { name: 'TypeScript Unit Tests', command: 'npm test', critical: true }, { name: 'Comprehensive Language Support', command: 'node tests/test-comprehensive-language-support.js', critical: true }, { name: 'File Extension Mapping', command: 'node tests/test-file-extension-mapping.js', critical: true }, { name: 'Existing Language Detection', command: 'node tests/test-lang-detect.js', critical: false }, { name: 'Tree-sitter Debug', command: 'node tests/test-tree-sitter-debug.js', critical: false } ]; let passed = 0; let failed = 0; const results = []; for (const test of tests) { console.log(`๐Ÿ” Running: ${test.name}`); console.log(` Command: ${test.command}`); try { const output = execSync(test.command, { encoding: 'utf-8', timeout: 60000, // 60 second timeout maxBuffer: 1024 * 1024 * 10 // 10MB buffer }); console.log(` โœ… PASSED`); if (output.includes('โŒ') || output.includes('FAIL')) { console.log(` โš ๏ธ Warning: Output contains failure indicators`); console.log(' Output excerpt:', output.split('\n').slice(-5).join('\n')); } passed++; results.push({ name: test.name, status: 'passed', critical: test.critical }); } catch (error) { console.log(` โŒ FAILED`); console.log(` Error: ${error.message}`); if (error.stdout) { console.log(' Stdout:', error.stdout.split('\n').slice(-3).join('\n')); } if (error.stderr) { console.log(' Stderr:', error.stderr.split('\n').slice(-3).join('\n')); } failed++; results.push({ name: test.name, status: 'failed', error: error.message, critical: test.critical }); // Stop on critical test failures if (test.critical) { console.log(`\n๐Ÿ’ฅ Critical test failed: ${test.name}`); console.log(' Stopping test execution due to critical failure.\n'); break; } } console.log(''); } // Final summary console.log('๐Ÿ“Š Test Suite Summary:'); console.log(` โœ… Passed: ${passed}`); console.log(` โŒ Failed: ${failed}`); console.log(` ๐Ÿ“ˆ Success Rate: ${Math.round((passed / (passed + failed)) * 100)}%`); console.log('\n๐Ÿ“‹ Detailed Results:'); results.forEach(result => { const icon = result.status === 'passed' ? 'โœ…' : 'โŒ'; const critical = result.critical ? ' (CRITICAL)' : ''; console.log(` ${icon} ${result.name}${critical}`); if (result.error) { console.log(` Error: ${result.error}`); } }); // Check if we can build console.log('\n๐Ÿ”จ Testing build process...'); try { console.log(' Building Rust core...'); execSync('cd rust-core && cargo build', { encoding: 'utf-8' }); console.log(' โœ… Rust build successful'); console.log(' Building TypeScript...'); execSync('npm run build', { encoding: 'utf-8' }); console.log(' โœ… TypeScript build successful'); } catch (buildError) { console.log(' โŒ Build failed:', buildError.message); failed++; } // Overall assessment const criticalFailures = results.filter(r => r.status === 'failed' && r.critical).length; if (criticalFailures === 0 && passed > failed) { console.log('\n๐ŸŽ‰ All critical tests passed! Changes are ready for commit.'); console.log(' โœจ Language support expansion appears successful.'); process.exit(0); } else { console.log('\nโš ๏ธ Some tests failed. Review failures before committing.'); if (criticalFailures > 0) { console.log(` ๐Ÿ’ฅ ${criticalFailures} critical failure(s) detected.`); } process.exit(1); } } runAllTests().catch(error => { console.error('๐Ÿ’ฅ Test runner failed:', error); process.exit(1); });

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/pi22by7/In-Memoria'

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