fix(test): Fix flaky shell command test using date command (#10863)

This commit is contained in:
shrutip90
2025-10-10 10:48:24 -07:00
committed by GitHub
parent affd3cae9a
commit 249ea55942

View File

@@ -228,13 +228,14 @@ describe('run_shell_command', () => {
).toBeTruthy();
});
//TODO - https://github.com/google-gemini/gemini-cli/issues/10768
it.skip('should allow all with "ShellTool" and other specifics', async () => {
it('should allow all with "ShellTool" and other specific tools', async () => {
const rig = new TestRig();
await rig.setup('should allow all with "ShellTool" and other specifics');
await rig.setup(
'should allow all with "ShellTool" and other specific tools',
);
const { tool } = getLineCountCommand();
const prompt = `use date`;
const prompt = `Please run the command "echo test-allow-all" and show me the output`;
const result = await rig.run({
stdin: prompt,
@@ -246,9 +247,10 @@ describe('run_shell_command', () => {
const foundToolCall = await rig.waitForToolCall('run_shell_command', 15000);
if (!foundToolCall) {
if (!foundToolCall || !result.includes('test-allow-all')) {
printDebugInfo(rig, result, {
'Found tool call': foundToolCall,
Result: result,
});
}
@@ -256,6 +258,13 @@ describe('run_shell_command', () => {
foundToolCall,
'Expected to find a run_shell_command tool call',
).toBeTruthy();
// Validate model output - will throw if no output, warn if missing expected content
validateModelOutput(
result,
'test-allow-all',
'Shell command stdin allow all',
);
});
it('should propagate environment variables to the child process', async () => {