Disable flakey tests. (#10914)

This commit is contained in:
Tommaso Sciortino
2025-10-10 11:02:36 -07:00
committed by GitHub
parent 849cd1f9ed
commit 32db4ff66d
2 changed files with 49 additions and 54 deletions

View File

@@ -18,69 +18,64 @@ describe('Interactive file system', () => {
await rig.cleanup();
});
it.skipIf(process.platform === 'win32')(
'should perform a read-then-write sequence',
async () => {
const fileName = 'version.txt';
rig.setup('interactive-read-then-write');
rig.createFile(fileName, '1.0.0');
it.skip('should perform a read-then-write sequence', async () => {
const fileName = 'version.txt';
rig.setup('interactive-read-then-write');
rig.createFile(fileName, '1.0.0');
const { ptyProcess } = rig.runInteractive();
const { ptyProcess } = rig.runInteractive();
const authDialogAppeared = await rig.waitForText(
'How would you like to authenticate',
5000,
);
const authDialogAppeared = await rig.waitForText(
'How would you like to authenticate',
5000,
);
// select the second option if auth dialog come's up
if (authDialogAppeared) {
ptyProcess.write('2');
}
// select the second option if auth dialog come's up
if (authDialogAppeared) {
ptyProcess.write('2');
}
// Wait for the app to be ready
const isReady = await rig.waitForText('Type your message', 30000);
expect(
isReady,
'CLI did not start up in interactive mode correctly',
).toBe(true);
// Wait for the app to be ready
const isReady = await rig.waitForText('Type your message', 30000);
expect(isReady, 'CLI did not start up in interactive mode correctly').toBe(
true,
);
// Step 1: Read the file
const readPrompt = `Read the version from ${fileName}`;
await type(ptyProcess, readPrompt);
await type(ptyProcess, '\r');
// Step 1: Read the file
const readPrompt = `Read the version from ${fileName}`;
await type(ptyProcess, readPrompt);
await type(ptyProcess, '\r');
const readCall = await rig.waitForToolCall('read_file', 30000);
expect(readCall, 'Expected to find a read_file tool call').toBe(true);
const readCall = await rig.waitForToolCall('read_file', 30000);
expect(readCall, 'Expected to find a read_file tool call').toBe(true);
const containsExpectedVersion = await rig.waitForText('1.0.0', 30000);
expect(
containsExpectedVersion,
'Expected to see version "1.0.0" in output',
).toBe(true);
const containsExpectedVersion = await rig.waitForText('1.0.0', 30000);
expect(
containsExpectedVersion,
'Expected to see version "1.0.0" in output',
).toBe(true);
// Step 2: Write the file
const writePrompt = `now change the version to 1.0.1 in the file`;
await type(ptyProcess, writePrompt);
await type(ptyProcess, '\r');
// Step 2: Write the file
const writePrompt = `now change the version to 1.0.1 in the file`;
await type(ptyProcess, writePrompt);
await type(ptyProcess, '\r');
const toolCall = await rig.waitForAnyToolCall(
['write_file', 'replace'],
30000,
);
const toolCall = await rig.waitForAnyToolCall(
['write_file', 'replace'],
30000,
);
if (!toolCall) {
printDebugInfo(rig, rig._interactiveOutput, {
toolCall,
});
}
expect(
if (!toolCall) {
printDebugInfo(rig, rig._interactiveOutput, {
toolCall,
'Expected to find a write_file or replace tool call',
).toBe(true);
});
}
const newFileContent = rig.readFile(fileName);
expect(newFileContent).toBe('1.0.1');
},
);
expect(toolCall, 'Expected to find a write_file or replace tool call').toBe(
true,
);
const newFileContent = rig.readFile(fileName);
expect(newFileContent).toBe('1.0.1');
});
});

View File

@@ -7,7 +7,7 @@
import { describe, it, expect, vi } from 'vitest';
import { TestRig, printDebugInfo, validateModelOutput } from './test-helper.js';
describe('replace', () => {
describe.skip('replace', () => {
it('should be able to replace content in a file', async () => {
const rig = new TestRig();
await rig.setup('should be able to replace content in a file');