mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
fix integration test static errors, and run_shell_command tests to actually be testing what they intend (#11050)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user