mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-05 07:37:50 -07:00
agent harnness
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
||||
import { TestRig } from './test-helper.js';
|
||||
|
||||
describe('Agent Harness E2E', () => {
|
||||
let rig: TestRig;
|
||||
|
||||
beforeEach(() => {
|
||||
rig = new TestRig();
|
||||
});
|
||||
|
||||
afterEach(async () => await rig.cleanup());
|
||||
|
||||
it('should execute a simple prompt using the agent harness', async () => {
|
||||
await rig.setup('agent-harness-simple');
|
||||
|
||||
// Run with the harness enabled via env var
|
||||
// Turn 1
|
||||
const result1 = await rig.run({
|
||||
args: ['chat', 'My name is GeminiUser'],
|
||||
env: {
|
||||
...process.env,
|
||||
GEMINI_ENABLE_AGENT_HARNESS: 'true',
|
||||
},
|
||||
});
|
||||
expect(result1).toBeDefined();
|
||||
|
||||
// Turn 2
|
||||
const result2 = await rig.run({
|
||||
args: ['chat', 'What is my name?', '--resume', 'latest'],
|
||||
env: {
|
||||
...process.env,
|
||||
GEMINI_ENABLE_AGENT_HARNESS: 'true',
|
||||
},
|
||||
});
|
||||
|
||||
expect(result2).toContain('GeminiUser');
|
||||
}, 30000);
|
||||
});
|
||||
Reference in New Issue
Block a user