mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -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();
|
).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
//TODO - https://github.com/google-gemini/gemini-cli/issues/10768
|
it('should allow all with "ShellTool" and other specific tools', async () => {
|
||||||
it.skip('should allow all with "ShellTool" and other specifics', async () => {
|
|
||||||
const rig = new TestRig();
|
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 { 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({
|
const result = await rig.run({
|
||||||
stdin: prompt,
|
stdin: prompt,
|
||||||
@@ -246,9 +247,10 @@ describe('run_shell_command', () => {
|
|||||||
|
|
||||||
const foundToolCall = await rig.waitForToolCall('run_shell_command', 15000);
|
const foundToolCall = await rig.waitForToolCall('run_shell_command', 15000);
|
||||||
|
|
||||||
if (!foundToolCall) {
|
if (!foundToolCall || !result.includes('test-allow-all')) {
|
||||||
printDebugInfo(rig, result, {
|
printDebugInfo(rig, result, {
|
||||||
'Found tool call': foundToolCall,
|
'Found tool call': foundToolCall,
|
||||||
|
Result: result,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,6 +258,13 @@ describe('run_shell_command', () => {
|
|||||||
foundToolCall,
|
foundToolCall,
|
||||||
'Expected to find a run_shell_command tool call',
|
'Expected to find a run_shell_command tool call',
|
||||||
).toBeTruthy();
|
).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 () => {
|
it('should propagate environment variables to the child process', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user