test(core): update scheduler registry mock (#3415)
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Test-1 (push) Blocked by required conditions
Qwen Code CI / Test-2 (push) Blocked by required conditions
Qwen Code CI / Test-3 (push) Blocked by required conditions
Qwen Code CI / Test-4 (push) Blocked by required conditions
Qwen Code CI / Test-5 (push) Blocked by required conditions
Qwen Code CI / Test-6 (push) Blocked by required conditions
Qwen Code CI / Test-7 (push) Blocked by required conditions
Qwen Code CI / Test-8 (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run

Update the CoreToolScheduler retry-loop test registry mock to match the current
  ToolRegistry interface. Add ensureTool and getAllToolNames so the tests exercise
  the scheduler path used in production.
This commit is contained in:
Reid 2026-04-18 13:46:46 +08:00 committed by GitHub
parent a1d1e5e276
commit 7eba1c4635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3919,16 +3919,22 @@ describe('CoreToolScheduler validation retry loop detection', () => {
function createSchedulerWithTool(tool: StrictStringTool) {
const mockToolRegistry = {
getTool: () => tool,
ensureTool: async (name: string) =>
name === StrictStringTool.Name ? tool : undefined,
getTool: (name: string) =>
name === StrictStringTool.Name ? tool : undefined,
getFunctionDeclarations: () => [],
tools: new Map(),
discovery: {},
registerTool: () => {},
getToolByName: () => tool,
getToolByDisplayName: () => tool,
getToolByName: (name: string) =>
name === StrictStringTool.Name ? tool : undefined,
getToolByDisplayName: (name: string) =>
name === 'StrictStringTool' ? tool : undefined,
getTools: () => [],
discoverTools: async () => {},
getAllTools: () => [],
getAllToolNames: () => [StrictStringTool.Name],
getToolsByServer: () => [],
} as unknown as ToolRegistry;