Skip to main content
Glama
run-comprehensive-test.cjs2.37 kB
#!/usr/bin/env node /** * Test Runner Script * Sets up environment and runs the comprehensive API test */ const { spawn } = require('child_process'); const path = require('path'); function log(message, level = 'info') { const timestamp = new Date().toISOString(); const levelEmoji = { info: '📋', success: '✅', error: '❌', warning: '⚠️' }[level] || '📋'; console.log(`${timestamp} ${levelEmoji} ${message}`); } async function runTest() { log('🚀 Starting Comprehensive API Test Runner', 'info'); // Check if passwords are available const saolaPassword = process.env.SAOLA_PASSWORD; const allcloudPassword = process.env.ALLCLOUD_PASSWORD; if (!saolaPassword || !allcloudPassword) { log('Environment variables needed for testing:', 'warning'); log(' export SAOLA_PASSWORD="your_saola_password"', 'info'); log(' export ALLCLOUD_PASSWORD="your_allcloud_password"', 'info'); log('Setting default test passwords...', 'warning'); // Set defaults if not provided (user should set real passwords) if (!process.env.SAOLA_PASSWORD) { process.env.SAOLA_PASSWORD = 'test_password_needed'; } if (!process.env.ALLCLOUD_PASSWORD) { process.env.ALLCLOUD_PASSWORD = 'test_password_needed'; } } // Run the comprehensive test const testScript = path.join(__dirname, 'direct-api-comprehensive-test.cjs'); log(`Running comprehensive test: ${testScript}`, 'info'); const child = spawn('node', [testScript], { stdio: 'inherit', env: process.env }); return new Promise((resolve, reject) => { child.on('exit', (code) => { if (code === 0) { log('✅ Test completed successfully!', 'success'); resolve(code); } else { log(`❌ Test failed with exit code: ${code}`, 'error'); reject(new Error(`Test failed with code ${code}`)); } }); child.on('error', (error) => { log(`❌ Failed to start test: ${error.message}`, 'error'); reject(error); }); }); } // Main execution if (require.main === module) { runTest() .then(() => { log('🎉 All tests completed!', 'success'); process.exit(0); }) .catch((error) => { log(`❌ Test runner failed: ${error.message}`, 'error'); process.exit(1); }); } module.exports = { runTest };

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/daviddraiumbrella/invoice-monitoring'

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