mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
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:
@@ -218,7 +218,7 @@ jobs:
|
|||||||
UV_THREADPOOL_SIZE: '32'
|
UV_THREADPOOL_SIZE: '32'
|
||||||
NODE_ENV: 'test'
|
NODE_ENV: 'test'
|
||||||
shell: 'pwsh'
|
shell: 'pwsh'
|
||||||
run: 'npm run test:integration:sandbox:none'
|
run: 'npm run deflake:test:integration:sandbox:none'
|
||||||
|
|
||||||
e2e:
|
e2e:
|
||||||
name: 'E2E'
|
name: 'E2E'
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
import { expect, describe, it, beforeEach, afterEach } from 'vitest';
|
import { expect, describe, it, beforeEach, afterEach } from 'vitest';
|
||||||
import { TestRig } from './test-helper.js';
|
import { TestRig } from './test-helper.js';
|
||||||
|
|
||||||
describe.skip('Interactive file system', () => {
|
describe('Interactive file system', () => {
|
||||||
let rig: TestRig;
|
let rig: TestRig;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -33,16 +33,16 @@ describe.skip('Interactive file system', () => {
|
|||||||
const readCall = await rig.waitForToolCall('read_file', 30000);
|
const readCall = await rig.waitForToolCall('read_file', 30000);
|
||||||
expect(readCall, 'Expected to find a read_file tool call').toBe(true);
|
expect(readCall, 'Expected to find a read_file tool call').toBe(true);
|
||||||
|
|
||||||
await run.expectText('1.0.0', 30000);
|
|
||||||
|
|
||||||
// Step 2: Write the file
|
// Step 2: Write the file
|
||||||
const writePrompt = `now change the version to 1.0.1 in the file`;
|
const writePrompt = `now change the version to 1.0.1 in the file`;
|
||||||
await run.type(writePrompt);
|
await run.type(writePrompt);
|
||||||
await run.sendKeys('\r');
|
await run.sendKeys('\r');
|
||||||
|
|
||||||
await rig.expectToolCallSuccess(['write_file', 'replace'], 30000);
|
// Check tool calls made with right args
|
||||||
|
await rig.expectToolCallSuccess(
|
||||||
const newFileContent = rig.readFile(fileName);
|
['write_file', 'replace'],
|
||||||
expect(newFileContent).toBe('1.0.1');
|
30000,
|
||||||
|
(args) => args.includes('1.0.1') && args.includes(fileName),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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
|
// Use environment-specific timeout
|
||||||
if (!timeout) {
|
if (!timeout) {
|
||||||
timeout = getDefaultTimeout();
|
timeout = getDefaultTimeout();
|
||||||
@@ -642,7 +646,10 @@ export class TestRig {
|
|||||||
const toolLogs = this.readToolLogs();
|
const toolLogs = this.readToolLogs();
|
||||||
return toolNames.some((name) =>
|
return toolNames.some((name) =>
|
||||||
toolLogs.some(
|
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),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
+2
-2
@@ -21,8 +21,8 @@
|
|||||||
"start:a2a-server": "CODER_AGENT_PORT=41242 npm run start --workspace @google/gemini-cli-a2a-server",
|
"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",
|
"debug": "cross-env DEBUG=1 node --inspect-brk scripts/start.js",
|
||||||
"deflake": "node scripts/deflake.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: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:docker": "npm run deflake -- --command=\"npm run test:integration:sandbox:docker -- --retry=0",
|
||||||
"auth:npm": "npx google-artifactregistry-auth",
|
"auth:npm": "npx google-artifactregistry-auth",
|
||||||
"auth:docker": "gcloud auth configure-docker us-west1-docker.pkg.dev",
|
"auth:docker": "gcloud auth configure-docker us-west1-docker.pkg.dev",
|
||||||
"auth": "npm run auth:npm && npm run auth:docker",
|
"auth": "npm run auth:npm && npm run auth:docker",
|
||||||
|
|||||||
Reference in New Issue
Block a user