mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
fix(ci): pre-download ripgrep in global setup to prevent race conditions (#12886)
This commit is contained in:
@@ -12,6 +12,7 @@ if (process.env['NO_COLOR'] !== undefined) {
|
|||||||
import { mkdir, readdir, rm } from 'node:fs/promises';
|
import { mkdir, readdir, rm } from 'node:fs/promises';
|
||||||
import { join, dirname } from 'node:path';
|
import { join, dirname } from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import { canUseRipgrep } from '../packages/core/src/tools/ripGrep.js';
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
const rootDir = join(__dirname, '..');
|
const rootDir = join(__dirname, '..');
|
||||||
@@ -32,6 +33,12 @@ export async function setup() {
|
|||||||
// construct the path before the HOME env var is set.
|
// construct the path before the HOME env var is set.
|
||||||
process.env['GEMINI_CONFIG_DIR'] = join(runDir, '.gemini');
|
process.env['GEMINI_CONFIG_DIR'] = join(runDir, '.gemini');
|
||||||
|
|
||||||
|
// Download ripgrep to avoid race conditions in parallel tests
|
||||||
|
const available = await canUseRipgrep();
|
||||||
|
if (!available) {
|
||||||
|
throw new Error('Failed to download ripgrep binary');
|
||||||
|
}
|
||||||
|
|
||||||
// Clean up old test runs, but keep the latest few for debugging
|
// Clean up old test runs, but keep the latest few for debugging
|
||||||
try {
|
try {
|
||||||
const testRuns = await readdir(integrationTestsDir);
|
const testRuns = await readdir(integrationTestsDir);
|
||||||
|
|||||||
Reference in New Issue
Block a user