mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
fix(test): Fix flaky shell command test using date command (#10863)
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user