mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 23:14:32 -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 new Promise((resolve) => setTimeout(resolve, 100));
|
||||||
await type(ptyProcess, '\r');
|
await type(ptyProcess, '\r');
|
||||||
|
|
||||||
const foundEvent = await rig.waitForTelemetryEvent(
|
|
||||||
'chat_compression',
|
|
||||||
90000,
|
|
||||||
);
|
|
||||||
expect(foundEvent).toBe(true);
|
|
||||||
|
|
||||||
const compressionFailed = await rig.waitForText(
|
const compressionFailed = await rig.waitForText(
|
||||||
'compression was not beneficial',
|
'compression was not beneficial',
|
||||||
25000,
|
25000,
|
||||||
|
|||||||
@@ -140,13 +140,14 @@ describe('replace', () => {
|
|||||||
it('should insert a multi-line block of text', async () => {
|
it('should insert a multi-line block of text', async () => {
|
||||||
const rig = new TestRig();
|
const rig = new TestRig();
|
||||||
await rig.setup('should insert a multi-line block of text');
|
await rig.setup('should insert a multi-line block of text');
|
||||||
const fileName = 'insert_block.js';
|
const fileName = 'insert_block.txt';
|
||||||
const originalContent = 'function hello() {\n // INSERT_CODE_HERE\n}';
|
const originalContent = 'Line A\n<INSERT_TEXT_HERE>\nLine C';
|
||||||
const newBlock = "console.log('hello');\n console.log('world');";
|
const newBlock = 'First line\nSecond line\nThird line';
|
||||||
const expectedContent = `function hello() {\n ${newBlock}\n}`;
|
const expectedContent =
|
||||||
|
'Line A\nFirst line\nSecond line\nThird line\nLine C';
|
||||||
rig.createFile(fileName, originalContent);
|
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 result = await rig.run(prompt);
|
||||||
|
|
||||||
const foundToolCall = await rig.waitForToolCall('replace');
|
const foundToolCall = await rig.waitForToolCall('replace');
|
||||||
|
|||||||
Reference in New Issue
Block a user