fix integration test static errors, and run_shell_command tests to actually be testing what they intend (#11050)

This commit is contained in:
Jacob MacDonald
2025-10-14 11:36:49 -07:00
committed by GitHub
parent 49b66733c2
commit 99c7108bb0
6 changed files with 188 additions and 104 deletions
+22 -4
View File
@@ -158,6 +158,7 @@ interface ParsedLog {
function_args?: string;
success?: boolean;
duration_ms?: number;
request_text?: string;
};
scopeMetrics?: {
metrics: {
@@ -315,10 +316,19 @@ export class TestRig {
run(
promptOrOptions:
| string
| { prompt?: string; stdin?: string; stdinDoesNotEnd?: boolean },
| {
prompt?: string;
stdin?: string;
stdinDoesNotEnd?: boolean;
yolo?: boolean;
},
...args: string[]
): Promise<string> {
const { command, initialArgs } = this._getCommandAndArgs(['--yolo']);
const yolo =
typeof promptOrOptions === 'string' || promptOrOptions.yolo !== false;
const { command, initialArgs } = this._getCommandAndArgs(
yolo ? ['--yolo'] : [],
);
const commandArgs = [...initialArgs];
const execOptions: {
cwd: string;
@@ -566,7 +576,11 @@ export class TestRig {
);
}
async waitForToolCall(toolName: string, timeout?: number) {
async waitForToolCall(
toolName: string,
timeout?: number,
matchArgs?: (args: string) => boolean,
) {
// Use environment-specific timeout
if (!timeout) {
timeout = getDefaultTimeout();
@@ -578,7 +592,11 @@ export class TestRig {
return poll(
() => {
const toolLogs = this.readToolLogs();
return toolLogs.some((log) => log.toolRequest.name === toolName);
return toolLogs.some(
(log) =>
log.toolRequest.name === toolName &&
(matchArgs?.call(this, log.toolRequest.args) ?? true),
);
},
timeout,
100,