Fix(tests): update mcp_server_cyclic_schema test (#5733)

This commit is contained in:
N. Taylor Mullen 2025-08-06 16:59:50 -07:00 committed by GitHub
parent 9ac3e8b79e
commit 01f7c4b740
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 10 deletions

View File

@ -14,7 +14,7 @@ import { strict as assert } from 'node:assert';
import { TestRig } from './test-helper.js';
import { join } from 'path';
import { fileURLToPath } from 'url';
import { writeFileSync, readFileSync } from 'fs';
import { writeFileSync } from 'fs';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
@ -191,16 +191,9 @@ describe('mcp server with cyclic tool schema is detected', () => {
// Or, possibly it could mean that gemini has fixed the issue.
const output = await rig.run('hello');
// The error message is in a log file, so we need to extract the path and read it.
const match = output.match(/Full report available at: (.*\.json)/);
assert(match, `Could not find log file path in output: ${output}`);
const logFilePath = match[1];
const logFileContent = readFileSync(logFilePath, 'utf-8');
assert.match(
logFileContent,
/ - tool_with_cyclic_schema \(cyclic-schema-server MCP Server\)/,
output,
/Skipping tool 'tool_with_cyclic_schema' from MCP server 'cyclic-schema-server' because it has missing types in its parameter schema/,
);
});
});