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:
1 parent
4852c830af
commit
52c84f6f58
4 files changed
+19
-13
No files matched your search
@@ -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({
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
Vendored
+7
-1
@@ -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. */
|
||||
|
||||
Reference in new issue
Block a user