mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:15:59 +00:00
perf(tests): reuse MCP connections within source matrices
Reuse test-owned stdio MCP connections within two stateless source-analysis matrices while retaining every original CLI/MCP scenario, schema/Evidence checks and test-finished cleanup. Add cross-input identity controls. Validation: 23 focused public-workflow tests and complete check:ci passed; stale-response fault detected. Exact-head hosted CI and available review passed. Pinned workload measurements and their limits are recorded in the PR. Refs #4737.
This commit is contained in:
1 parent
715c9c8a84
commit
9d5b931875
2 files changed
+26
-4
No files matched your search
@@ -21,11 +21,12 @@ export const runNodeJsonControl = async (
|
||||
return JSON.parse(stdout) as unknown;
|
||||
};
|
||||
|
||||
/** Analyze a directory through a public adapter and validate its result contract. */
|
||||
/** Analyze a directory; a supplied MCP caller reuses its test-owned connection. */
|
||||
export const analyzeJavaScriptDirectory = async (
|
||||
surface: "CLI" | "stdio MCP",
|
||||
cli: TestCli,
|
||||
root: string,
|
||||
mcpCall?: Awaited<ReturnType<typeof connectLocalToolsMcp>>["call"],
|
||||
) => {
|
||||
let document: unknown;
|
||||
if (surface === "CLI") {
|
||||
@@ -36,7 +37,7 @@ export const analyzeJavaScriptDirectory = async (
|
||||
expect(response.exitCode, response.stderr).toBe(0);
|
||||
document = response.json;
|
||||
} else {
|
||||
const { call } = await connectLocalToolsMcp();
|
||||
const call = mcpCall ?? (await connectLocalToolsMcp()).call;
|
||||
const response = await call("analyze_javascript_application", {
|
||||
input_path: root,
|
||||
format: "directory",
|
||||
|
||||
Reference in new issue
Block a user