feat(cli): implement visual validation framework and TTY smoke tests

This change introduces a multi-layered validation strategy for the Gemini CLI UI, including:
- TTY Bootstrap Smoke Tests using node-pty to validate real terminal startup.
- Visual Regression Testing using SVG snapshots and AppRig.
- Core fixes for a scheduler hang and suppressed policy violations.
- Comprehensive documentation for maintainers.
This commit is contained in:
mkorwel
2026-03-14 12:09:52 -07:00
parent 9f7691fd88
commit 5833b84d94
11 changed files with 257 additions and 33 deletions
@@ -0,0 +1,37 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, beforeEach, afterEach } from 'vitest';
import { TestRig } from '@google/gemini-cli-test-utils';
describe('Gemini CLI TTY Bootstrap', () => {
let rig: TestRig;
beforeEach(() => {
rig = new TestRig();
rig.setup('TTY Bootstrap Smoke Test');
});
afterEach(async () => {
await rig.cleanup();
});
it('should render the interactive UI and display the ready marker in a TTY', async () => {
// Spawning the CLI in a pseudo-TTY with a dummy API key to bypass auth prompt
const run = await rig.runInteractive({
env: { GEMINI_API_KEY: 'dummy-key' },
});
// The ready marker we expect to see
const readyMarker = 'Type your message or @path/to/file';
// Verify the initial render completes and displays the marker
await run.expectText(readyMarker, 30000);
// If we reached here, the smoke test passed
await run.kill();
});
});