Skip to content

Commit d49ed41

Browse files
committed
build: switch integration tests to pnpm and use rules_js-based rule
Switchs all integration tests to pnpm, solving one of our annoying bugs when installing integration test deps. It also seems much faster. In the future, we are considering allowing the local profile pnpm cache, even within the Bazel sandbox, but for now we continue installing dependencies via internet. In practice we even install a bit more dependencies now, but that is a trade-off we accept, because it's not making anything worse, but instead allows us to finally: - easily update the lock files manually - let renovate maintain versions of our integration tests; keeping them up-to-date.
1 parent 70887c8 commit d49ed41

23 files changed

+37296
-30100
lines changed

Diff for: .aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.npmrc=-1406867100
55
integration/package.json=-620011313
66
package.json=1797122117
7-
pnpm-lock.yaml=1639985799
7+
pnpm-lock.yaml=-1209925821
88
pnpm-workspace.yaml=334858811
99
src/cdk-experimental/package.json=237487315
1010
src/cdk/package.json=-908433069

Diff for: WORKSPACE

+2-4
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ rules_js_register_toolchains(
102102
)
103103

104104
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
105-
load("//tools:integration.bzl", "create_npm_package_archive_build_file")
106105

107106
yarn_install(
108107
name = "npm",
@@ -120,8 +119,6 @@ yarn_install(
120119
# 1. Missing Windows support currently.
121120
# 2. Incompatibilites with the `ts_library` rule.
122121
exports_directories_only = False,
123-
# Add archive targets for some NPM packages that are needed in integration tests.
124-
manual_build_file_contents = create_npm_package_archive_build_file(),
125122
package_json = "//:package.json",
126123
quiet = False,
127124
yarn = "//:.yarn/releases/yarn-1.22.17.cjs",
@@ -203,6 +200,7 @@ npm_translate_lock(
203200
"@angular/material-luxon-adapter": ["//integration:__subpackages__"],
204201
},
205202
pnpm_lock = "//:pnpm-lock.yaml",
203+
pnpm_version = "9.14.1",
206204
update_pnpm_lock = True,
207205
verify_node_modules_ignored = "//:.bazelignore",
208206
yarn_lock = "//:yarn.lock",
@@ -249,7 +247,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
249247

250248
git_repository(
251249
name = "devinfra",
252-
commit = "cddc66a76ac0183790bc7a9fc1e5cf9f87512375",
250+
commit = "c4f7d3cdec164044284139182b709dfd4be339ed",
253251
remote = "https://github.com/angular/dev-infra.git",
254252
)
255253

Diff for: integration/harness-e2e-cli/BUILD.bazel

+6-26
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,16 @@
1-
load("@bazel_skylib//lib:dicts.bzl", "dicts")
2-
load("//tools:integration.bzl", "CLI_PROJECT_MAPPINGS")
3-
load("//tools:defaults.bzl", "node_integration_test")
1+
load("//tools:integration.bzl", "LOCAL_NPM_PACKAGES", "integration_test")
42

5-
npmPackageMappings = dicts.add(
6-
dicts.omit(
7-
CLI_PROJECT_MAPPINGS,
8-
# Exclude rxjs, because we want to use the version from the package.json.
9-
# Version 6.x that the rest of the project uses has some packaging issues. See:
10-
# https://github.com/angular/components/pull/25241#issuecomment-1178701633
11-
["@npm//:rxjs_archive"],
12-
),
13-
{
14-
"//src/cdk:npm_package_archive": "@angular/cdk",
15-
"//src/material:npm_package_archive": "@angular/material",
16-
},
17-
)
18-
19-
node_integration_test(
3+
integration_test(
204
name = "test",
215
srcs = glob(["**/*"]),
226
commands = [
23-
# Note: We use a cache folder within the integration test as otherwise
24-
# the NPM package mapped archive would be cached in the system.
25-
# See: https://github.com/yarnpkg/yarn/issues/2165.
26-
# TODO(devversion): determine if a solution/workaround could live in the test runner.
27-
"yarn install --cache-folder .yarn_cache_folder/",
28-
"yarn e2e",
7+
"pnpm i",
8+
"pnpm run e2e",
299
],
30-
npm_packages = npmPackageMappings,
10+
npm_packages = LOCAL_NPM_PACKAGES,
3111
setup_chromium = True,
3212
tags = [
33-
# This test relies on `yarn` so there needs to be internet access.
13+
# This test relies on `pnpm` so there needs to be internet access.
3414
"requires-network",
3515
],
3616
)

Diff for: integration/harness-e2e-cli/package.json

+19-23
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,35 @@
88
"watch": "ng build --watch --configuration development",
99
"test": "ng test",
1010
"run-e2e-specs": "node --loader ts-node/esm node_modules/jasmine/bin/jasmine --config=e2e/jasmine.json",
11-
"wait-and-run-e2e": "wait-on http://localhost:4200 && yarn run-e2e-specs",
12-
"e2e": "concurrently -s first -k 'ng serve' 'yarn wait-and-run-e2e'"
11+
"wait-and-run-e2e": "wait-on http://localhost:4200 && pnpm run-e2e-specs",
12+
"e2e": "concurrently -s first -k 'pnpm ng serve' 'pnpm wait-and-run-e2e'"
1313
},
1414
"private": true,
1515
"dependencies": {
16-
"@angular/animations": "file:../../node_modules/@angular/animations",
17-
"@angular/cdk": "file:../../dist/releases/cdk",
18-
"@angular/common": "file:../../node_modules/@angular/common",
19-
"@angular/compiler": "file:../../node_modules/@angular/compiler",
20-
"@angular/core": "file:../../node_modules/@angular/core",
21-
"@angular/forms": "file:../../node_modules/@angular/forms",
22-
"@angular/material": "file:../../dist/releases/material",
23-
"@angular/platform-browser": "file:../../node_modules/@angular/platform-browser",
24-
"@angular/router": "file:../../node_modules/@angular/router",
16+
"@angular/animations": "20.0.0-next.5",
17+
"@angular/cdk": "next",
18+
"@angular/common": "20.0.0-next.5",
19+
"@angular/compiler": "20.0.0-next.5",
20+
"@angular/core": "20.0.0-next.5",
21+
"@angular/forms": "20.0.0-next.5",
22+
"@angular/material": "next",
23+
"@angular/platform-browser": "20.0.0-next.5",
24+
"@angular/router": "20.0.0-next.5",
2525
"rxjs": "^7.5.5",
2626
"tslib": "^2.3.0",
2727
"zone.js": "~0.15.0"
2828
},
2929
"devDependencies": {
30-
"@angular-devkit/build-angular": "file:../../node_modules/@angular-devkit/build-angular",
31-
"@angular/cli": "file:../../node_modules/@angular/cli",
32-
"@angular/compiler-cli": "file:../../node_modules/@angular/compiler-cli",
33-
"@types/jasmine": "~3.10.0",
34-
"@types/node": "^12.11.1",
30+
"@angular-devkit/build-angular": "20.0.0-next.4",
31+
"@angular/cli": "20.0.0-next.4",
32+
"@angular/compiler-cli": "20.0.0-next.5",
33+
"@types/jasmine": "5.1.7",
34+
"@types/node": "22.14.0",
3535
"@types/selenium-webdriver": "3.0.19",
3636
"concurrently": "^7.0.0",
37-
"jasmine": "^4.0.2",
38-
"jasmine-core": "~3.10.0",
39-
"karma": "~6.3.0",
37+
"jasmine": "5.6.0",
38+
"jasmine-core": "5.6.0",
39+
"karma": "6.4.4",
4040
"karma-chrome-launcher": "~3.1.0",
4141
"karma-coverage": "~2.1.0",
4242
"karma-jasmine": "~4.0.0",
@@ -45,9 +45,5 @@
4545
"ts-node": "~10.9.1",
4646
"typescript": "5.8.2",
4747
"wait-on": "^6.0.0"
48-
},
49-
"resolutions": {
50-
"string-width": "4.2.3",
51-
"wrap-ansi": "7.0.0"
5248
}
5349
}

0 commit comments

Comments
 (0)