fix(infra) - Make file system interactive test check only tool call (#11055)

Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com>
This commit is contained in:
shishu314
2025-10-17 17:25:31 -04:00
committed by GitHub
parent 21163a1636
commit 0b20f88fc0
4 changed files with 19 additions and 12 deletions

View File

@@ -218,7 +218,7 @@ jobs:
UV_THREADPOOL_SIZE: '32'
NODE_ENV: 'test'
shell: 'pwsh'
run: 'npm run test:integration:sandbox:none'
run: 'npm run deflake:test:integration:sandbox:none'
e2e:
name: 'E2E'

View File

@@ -7,7 +7,7 @@
import { expect, describe, it, beforeEach, afterEach } from 'vitest';
import { TestRig } from './test-helper.js';
describe.skip('Interactive file system', () => {
describe('Interactive file system', () => {
let rig: TestRig;
beforeEach(() => {
@@ -33,16 +33,16 @@ describe.skip('Interactive file system', () => {
const readCall = await rig.waitForToolCall('read_file', 30000);
expect(readCall, 'Expected to find a read_file tool call').toBe(true);
await run.expectText('1.0.0', 30000);
// Step 2: Write the file
const writePrompt = `now change the version to 1.0.1 in the file`;
await run.type(writePrompt);
await run.sendKeys('\r');
await rig.expectToolCallSuccess(['write_file', 'replace'], 30000);
const newFileContent = rig.readFile(fileName);
expect(newFileContent).toBe('1.0.1');
// Check tool calls made with right args
await rig.expectToolCallSuccess(
['write_file', 'replace'],
30000,
(args) => args.includes('1.0.1') && args.includes(fileName),
);
});
});

View File

@@ -628,7 +628,11 @@ export class TestRig {
);
}
async expectToolCallSuccess(toolNames: string[], timeout?: number) {
async expectToolCallSuccess(
toolNames: string[],
timeout?: number,
matchArgs?: (args: string) => boolean,
) {
// Use environment-specific timeout
if (!timeout) {
timeout = getDefaultTimeout();
@@ -642,7 +646,10 @@ export class TestRig {
const toolLogs = this.readToolLogs();
return toolNames.some((name) =>
toolLogs.some(
(log) => log.toolRequest.name === name && log.toolRequest.success,
(log) =>
log.toolRequest.name === name &&
log.toolRequest.success &&
(matchArgs?.call(this, log.toolRequest.args) ?? true),
),
);
},

View File

@@ -21,8 +21,8 @@
"start:a2a-server": "CODER_AGENT_PORT=41242 npm run start --workspace @google/gemini-cli-a2a-server",
"debug": "cross-env DEBUG=1 node --inspect-brk scripts/start.js",
"deflake": "node scripts/deflake.js",
"deflake:test:integration:sandbox:none": "npm run deflake -- --command='npm run test:integration:sandbox:none -- --retry=0'",
"deflake:test:integration:sandbox:docker": "npm run deflake -- --command='npm run test:integration:sandbox:docker -- --retry=0'",
"deflake:test:integration:sandbox:none": "npm run deflake -- --command=\"npm run test:integration:sandbox:none -- --retry=0",
"deflake:test:integration:sandbox:docker": "npm run deflake -- --command=\"npm run test:integration:sandbox:docker -- --retry=0",
"auth:npm": "npx google-artifactregistry-auth",
"auth:docker": "gcloud auth configure-docker us-west1-docker.pkg.dev",
"auth": "npm run auth:npm && npm run auth:docker",