From 249ea5594202c9d39cce894fbe92c1da39666a25 Mon Sep 17 00:00:00 2001 From: shrutip90 Date: Fri, 10 Oct 2025 10:48:24 -0700 Subject: [PATCH] fix(test): Fix flaky shell command test using date command (#10863) --- integration-tests/run_shell_command.test.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/integration-tests/run_shell_command.test.ts b/integration-tests/run_shell_command.test.ts index 4f4984c604..6d573f01fe 100644 --- a/integration-tests/run_shell_command.test.ts +++ b/integration-tests/run_shell_command.test.ts @@ -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 () => {