mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-16 21:10:40 -07:00
fix(test-rig): only clean test directories on first setup call for a rig instance
This commit is contained in:
@@ -353,6 +353,7 @@ export class TestRig {
|
|||||||
originalFakeResponsesPath?: string;
|
originalFakeResponsesPath?: string;
|
||||||
private _interactiveRuns: InteractiveRun[] = [];
|
private _interactiveRuns: InteractiveRun[] = [];
|
||||||
private _spawnedProcesses: ChildProcess[] = [];
|
private _spawnedProcesses: ChildProcess[] = [];
|
||||||
|
private _initialized = false;
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
testName: string,
|
testName: string,
|
||||||
@@ -374,18 +375,25 @@ export class TestRig {
|
|||||||
console.log(`[TestRig] homeDir: ${this.homeDir}`);
|
console.log(`[TestRig] homeDir: ${this.homeDir}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up existing directories from previous runs (e.g. retries)
|
if (!this._initialized) {
|
||||||
if (fs.existsSync(this.testDir)) {
|
// Clean up existing directories from previous runs (e.g. retries)
|
||||||
if (env['VERBOSE'] === 'true' || env['CI'] === 'true') {
|
if (fs.existsSync(this.testDir)) {
|
||||||
console.log(`[TestRig] Cleaning up existing testDir: ${this.testDir}`);
|
if (env['VERBOSE'] === 'true' || env['CI'] === 'true') {
|
||||||
|
console.log(
|
||||||
|
`[TestRig] Cleaning up existing testDir: ${this.testDir}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
fs.rmSync(this.testDir, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
fs.rmSync(this.testDir, { recursive: true, force: true });
|
if (fs.existsSync(this.homeDir)) {
|
||||||
}
|
if (env['VERBOSE'] === 'true' || env['CI'] === 'true') {
|
||||||
if (fs.existsSync(this.homeDir)) {
|
console.log(
|
||||||
if (env['VERBOSE'] === 'true' || env['CI'] === 'true') {
|
`[TestRig] Cleaning up existing homeDir: ${this.homeDir}`,
|
||||||
console.log(`[TestRig] Cleaning up existing homeDir: ${this.homeDir}`);
|
);
|
||||||
|
}
|
||||||
|
fs.rmSync(this.homeDir, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
fs.rmSync(this.homeDir, { recursive: true, force: true });
|
this._initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdirSync(this.testDir, { recursive: true });
|
mkdirSync(this.testDir, { recursive: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user