Skip to content

Commit 3ab59d3

Browse files
committed
ci: only install active package manager
This commit updates the e2e setup to only install the active package manager.
1 parent 6d266c1 commit 3ab59d3

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

tests/legacy-cli/e2e/initialize/300-log-environment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { getActivePackageManager } from '../utils/packages';
12
import { exec, ng } from '../utils/process';
23

34
export default async function () {
@@ -13,6 +14,6 @@ export default async function () {
1314
console.log(` ${envName}: ${process.env[envName]!.replace(/[\n\r]+/g, '\n ')}`);
1415
});
1516

16-
await exec('which', 'ng', 'yarn', 'npm', 'bun', 'pnpm');
17+
await exec('which', 'ng', getActivePackageManager());
1718
await ng('version');
1819
}
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getGlobalVariable } from '../utils/env';
2+
import { getActivePackageManager } from '../utils/packages';
23
import { globalNpm } from '../utils/process';
34

4-
const NPM_VERSION = '7.24.0'; // TODO: update to latest and fix tests.
5-
const YARN_VERSION = '1.22.22';
6-
const PNPM_VERSION = '9.3.0';
7-
const BUN_VERSION = '1.1.13';
5+
const PACKAGE_MANAGER_VERSION = {
6+
'npm': '7.24.0', // TODO: update to latest and fix tests.
7+
'yarn': '1.22.22',
8+
'pnpm': '9.3.0',
9+
'bun': '1.1.13',
10+
};
811

912
export default async function () {
1013
const argv = getGlobalVariable('argv');
@@ -13,16 +16,14 @@ export default async function () {
1316
}
1417

1518
const testRegistry = getGlobalVariable('package-registry');
19+
const packageManager = getActivePackageManager();
1620

1721
// Install global Angular CLI being tested, npm+yarn used by e2e tests.
1822
await globalNpm([
1923
'install',
2024
'--global',
2125
`--registry=${testRegistry}`,
2226
'@angular/cli',
23-
`bun@${BUN_VERSION}`,
24-
`npm@${NPM_VERSION}`,
25-
`yarn@${YARN_VERSION}`,
26-
`pnpm@${PNPM_VERSION}`,
27+
`${packageManager}@${PACKAGE_MANAGER_VERSION[packageManager]}`,
2728
]);
2829
}

0 commit comments

Comments
 (0)