mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
test: fix flaky integration tests for compress command (#10371)
Co-authored-by: Taneja Hriday <hridayt@google.com> Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -99,12 +99,6 @@ describe('Interactive Mode', () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
await type(ptyProcess, '\r');
|
||||
|
||||
const foundEvent = await rig.waitForTelemetryEvent(
|
||||
'chat_compression',
|
||||
90000,
|
||||
);
|
||||
expect(foundEvent).toBe(true);
|
||||
|
||||
const compressionFailed = await rig.waitForText(
|
||||
'compression was not beneficial',
|
||||
25000,
|
||||
|
||||
@@ -140,13 +140,14 @@ describe('replace', () => {
|
||||
it('should insert a multi-line block of text', async () => {
|
||||
const rig = new TestRig();
|
||||
await rig.setup('should insert a multi-line block of text');
|
||||
const fileName = 'insert_block.js';
|
||||
const originalContent = 'function hello() {\n // INSERT_CODE_HERE\n}';
|
||||
const newBlock = "console.log('hello');\n console.log('world');";
|
||||
const expectedContent = `function hello() {\n ${newBlock}\n}`;
|
||||
const fileName = 'insert_block.txt';
|
||||
const originalContent = 'Line A\n<INSERT_TEXT_HERE>\nLine C';
|
||||
const newBlock = 'First line\nSecond line\nThird line';
|
||||
const expectedContent =
|
||||
'Line A\nFirst line\nSecond line\nThird line\nLine C';
|
||||
rig.createFile(fileName, originalContent);
|
||||
|
||||
const prompt = `In ${fileName}, replace "// INSERT_CODE_HERE" with:\n${newBlock}`;
|
||||
const prompt = `In ${fileName}, replace "<INSERT_TEXT_HERE>" with:\n${newBlock}`;
|
||||
const result = await rig.run(prompt);
|
||||
|
||||
const foundToolCall = await rig.waitForToolCall('replace');
|
||||
|
||||
Reference in New Issue
Block a user