Skip to content

Commit 2b589d7

Browse files
committed
fix(react-integration-tester): remove Yarn Classic flags from yarn install command
1 parent 88aca8e commit 2b589d7

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

tools/react-integration-tester/src/__tests__/cli.e2e.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ describe('rit CLI e2e', () => {
133133
expect(yarn).toBeTruthy();
134134
expect(yarn?.cwd).toContain('tmp/rit/react-18');
135135

136-
expect(existsSync(join(fs.tempDir, 'tmp/rit/.yarn-cache'))).toBeTruthy();
137136
expect(readJSON(join(fs.tempDir, 'tmp/rit/react-18/package.json'))).toMatchInlineSnapshot(`
138137
Object {
139138
"dependencies": Object {

tools/react-integration-tester/src/setup.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,22 +272,18 @@ function prepareTsConfigTemplate(options: {
272272
};
273273
}
274274

275-
async function installDependenciesAtReactRoot(reactVersionRootPath: string, opts: { scaffoldRoot: string }) {
276-
// Use a scoped global yarn cache and a global mutex to avoid concurrent cache corruption on CI
277-
const yarnCacheFolder = join(opts.scaffoldRoot, '.yarn-cache');
278-
275+
async function installDependenciesAtReactRoot(reactVersionRootPath: string) {
279276
if (!existsSync(join(reactVersionRootPath, 'package.json'))) {
280277
throw new Error(`Missing package.json at react root: ${reactVersionRootPath}`);
281278
}
282279

283-
mkdirSync(yarnCacheFolder, { recursive: true });
284280
// small retry loop
285281
const maxAttempts = 3;
286282
let attempt = 0;
287283
while (true) {
288284
try {
289285
attempt += 1;
290-
await runCmd(`yarn install --mutex network --network-timeout 60000 --cache-folder ${yarnCacheFolder}`, {
286+
await runCmd(`yarn install`, {
291287
cwd: reactVersionRootPath,
292288
});
293289
break;
@@ -334,7 +330,7 @@ async function ensureDependencies(params: {
334330

335331
case 'run-install': {
336332
params.logger.verbose(`Installing dependencies for React ${params.react}...`);
337-
await installDependenciesAtReactRoot(params.reactRootPath, { scaffoldRoot: params.mode.scaffoldRoot });
333+
await installDependenciesAtReactRoot(params.reactRootPath);
338334
return;
339335
}
340336
}
@@ -527,7 +523,7 @@ export async function installDepsForReactVersion(
527523

528524
logger.verbose(`Installing dependencies under: ${reactRootPath}`);
529525

530-
await installDependenciesAtReactRoot(reactRootPath, { scaffoldRoot });
526+
await installDependenciesAtReactRoot(reactRootPath);
531527

532528
logger.log(`Dependencies installed under shared react root -> ${reactRootPath}.`);
533529
}

0 commit comments

Comments
 (0)