Skip to main content
Glama
cli.ts2.17 kB
import { RegressionTestSuite } from './RegressionTestSuite'; import { RegressionTestCase, TestResult } from './types'; import fs from 'fs'; import path from 'path'; import chalk from 'chalk'; import { writeJUnitReport } from './junitReporter'; async function run() { console.log(chalk.bold.inverse(' Tally MCP Regression Test Suite ')); const suite = new RegressionTestSuite(); const testsDir = path.resolve(__dirname, 'tests'); // Load tests const testFiles = fs.readdirSync(testsDir).filter(file => file.endsWith('.test.ts') || file.endsWith('.test.js')); for (const file of testFiles) { const filePath = path.resolve(testsDir, file); const testModule = await import(filePath); for (const key in testModule) { if (testModule[key] && typeof testModule[key] === 'object' && 'id' in testModule[key]) { suite.addTest(testModule[key] as RegressionTestCase); } } } console.log(`\nFound ${chalk.bold(suite.getTestCases().length.toString())} test cases.`); // Run tests const results = await suite.runAll(); // Report results console.log(chalk.bold('\nTest Results:')); let passedCount = 0; results.forEach(result => { if (result.passed) { console.log(chalk.green(`✔ PASS `) + `${result.testCaseId} (${result.duration}ms)`); passedCount++; } else { console.log(chalk.red(`✖ FAIL `) + `${result.testCaseId} (${result.duration}ms)`); console.log(chalk.gray(` └─ ${result.message}`)); } }); console.log(chalk.bold('\nSummary:')); console.log(`${chalk.green(passedCount.toString())} passed, ${chalk.red((results.length - passedCount).toString())} failed.`); // Write JUnit report writeJUnitReport(results, path.resolve(__dirname, '../../reports')); if (results.some(r => !r.passed)) { process.exit(1); // Exit with error code if any tests failed } } run().catch(error => { console.error(chalk.red('\nAn unexpected error occurred while running the test suite:')); console.error(error); process.exit(1); });

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/learnwithcc/tally-mcp'

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