mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
fix(int-tests): fix failing integration tests (#7516)
This commit is contained in:
@@ -31,7 +31,7 @@ describe('session-summary flag', () => {
|
||||
const summary = JSON.parse(summaryContent);
|
||||
|
||||
expect(summary).toBeDefined();
|
||||
expect(summary.models).toBeDefined();
|
||||
expect(summary.tools).toBeDefined();
|
||||
expect(summary.sessionMetrics.models).toBeDefined();
|
||||
expect(summary.sessionMetrics.tools).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { writeFileSync, readFileSync } from 'node:fs';
|
||||
import { join, resolve } from 'node:path';
|
||||
import { TestRig } from './test-helper.js';
|
||||
|
||||
// Windows skip (Option A: avoid infra scope)
|
||||
@@ -50,10 +50,6 @@ const utf32BE = (s: string) => {
|
||||
return Buffer.concat([bom, payload]);
|
||||
};
|
||||
|
||||
// Minimal binary sentinel (PNG header only)
|
||||
const fakePng = () =>
|
||||
Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
|
||||
|
||||
let rig: TestRig;
|
||||
let dir: string;
|
||||
|
||||
@@ -126,7 +122,20 @@ d('BOM end-to-end integration', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('Binary sentinel', async () => {
|
||||
await runAndAssert('image.png', fakePng(), null);
|
||||
it('Can describe a PNG file', async () => {
|
||||
const imagePath = resolve(
|
||||
process.cwd(),
|
||||
'docs/assets/gemini-screenshot.png',
|
||||
);
|
||||
const imageContent = readFileSync(imagePath);
|
||||
const filename = 'gemini-screenshot.png';
|
||||
writeFileSync(join(dir, filename), imageContent);
|
||||
const prompt = `describe the image ${filename}`;
|
||||
const output = await rig.run(prompt);
|
||||
await rig.waitForToolCall('read_file');
|
||||
const lower = output.toLowerCase();
|
||||
expect(lower.includes('screenshot')).toBeTruthy();
|
||||
expect(lower.includes('gemini cli')).toBeTruthy();
|
||||
expect(lower.includes('terminal')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user