test(cli): bound ADB MCP validation to the advertised tool

Reuse the exact selected advertised descriptor for SDK output validation instead of compiling the entire cached catalog for every fresh parity-test client. Retain actual catalog discovery, schema validation, and all result assertions under the existing worker heap limit.
This commit is contained in:
morluto committed 2026-10-21 06:23:20 +08:00
1 parent 4852c830af
commit 52c84f6f58
4 files changed
+19 -13

No files matched your search

+4 -4
View File
@@ -60,10 +60,10 @@ if (args.length === 1 && args[0] === 'version') {
harness.client,
"uninstall_adb_package",
);
const response = await harness.client.callTool({
name: schemas.name,
arguments: input,
});
const response = await harness.client.callTool(
{ name: schemas.name, arguments: input },
{ toolDefinition: schemas.toolDefinition },
);
if (succeeds) {
const evidence = parseEvidence(output.json);
expect(evidence.normalized_result).toMatchObject({
+4 -4
View File
@@ -56,10 +56,10 @@ if (args.length === 1 && args[0] === 'version') {
harness.client,
"inspect_adb_window",
);
const response = await harness.client.callTool({
name: schemas.name,
arguments: { serial },
});
const response = await harness.client.callTool(
{ name: schemas.name, arguments: { serial } },
{ toolDefinition: schemas.toolDefinition },
);
expect(response.isError).not.toBe(true);
expect(
schemas.ajv.validate(schemas.outputSchema, response.structuredContent),
+4 -4
View File
@@ -76,10 +76,10 @@ exit 1
);
const args = { serial };
expect(schemas.ajv.validate(schemas.inputSchema, args)).toBe(true);
const response = await harness.client.callTool({
name: schemas.name,
arguments: args,
});
const response = await harness.client.callTool(
{ name: schemas.name, arguments: args },
{ toolDefinition: schemas.toolDefinition },
);
expect(response.isError).not.toBe(true);
expect(
schemas.ajv.validate(schemas.outputSchema, response.structuredContent),
+7 -1
View File
@@ -20,7 +20,13 @@ export const advertisedMcpToolSchemas = async (
const outputSchema: Record<string, unknown> = advertised.outputSchema;
expect(ajv.validateSchema(inputSchema)).toBe(true);
expect(ajv.validateSchema(outputSchema)).toBe(true);
return { name: advertised.name, ajv, inputSchema, outputSchema };
return {
name: advertised.name,
toolDefinition: advertised,
ajv,
inputSchema,
outputSchema,
};
};
/** Keep public output, provenance and session retention checks together. */