Skip to content

Commit a9205ee

Browse files
committed
build: update dev-infra and rework windows native testing
TODO
1 parent 3f2ab3a commit a9205ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+772
-227
lines changed

.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=-1406867100
55
modules/testing/builder/package.json=973445093
6-
package.json=-1149499346
6+
package.json=-1775791013
77
packages/angular/build/package.json=-1114621695
88
packages/angular/cli/package.json=-1917515334
99
packages/angular/pwa/package.json=1108903917
@@ -17,7 +17,7 @@ packages/angular_devkit/schematics/package.json=-1133510866
1717
packages/angular_devkit/schematics_cli/package.json=-2026655035
1818
packages/ngtools/webpack/package.json=-538346154
1919
packages/schematics/angular/package.json=251715148
20-
pnpm-lock.yaml=-1460727587
20+
pnpm-lock.yaml=922410961
2121
pnpm-workspace.yaml=-1264044456
2222
tests/package.json=700948366
23-
yarn.lock=1060210125
23+
yarn.lock=373819470

.bazelrc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ test:no-sharding --flaky_test_attempts=1 --test_sharding_strategy=disabled
3333
# See https://github.com/bazelbuild/bazel/issues/4603
3434
build --symlink_prefix=dist/
3535

36-
# Disable watchfs as it causes tests to be flaky on Windows
37-
# https://github.com/angular/angular/issues/29541
38-
build --nowatchfs
39-
4036
# Turn off legacy external runfiles
4137
build --nolegacy_external_runfiles
4238

@@ -162,10 +158,6 @@ build:remote-cache --google_default_credentials
162158
# Fixes use of npm paths with spaces such as some within the puppeteer module
163159
build --experimental_inprocess_symlink_creation
164160

165-
# Enable runfiles even on Windows.
166-
# Architect resolves output files from data files, and this isn't possible without runfile support.
167-
build --enable_runfiles
168-
169161
####################################################
170162
# rules_js specific flags
171163
####################################################
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: 'Native Windows Bazel e2e test'
2+
description: 'Runs an Angular CLI e2e Bazel test on native Windows (dispatched from inside WSL)'
3+
author: 'Angular'
4+
5+
inputs:
6+
test_target_name:
7+
description: E2E test target name
8+
required: true
9+
test_args:
10+
description: |
11+
TODO
12+
required: false
13+
default: ''
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Setup Bazel RBE
19+
uses: angular/dev-infra/github-actions/bazel/configure-remote@2667d139a421977a40c3ea7ec768609fb19a8b9d
20+
with:
21+
allow_windows_rbe: true
22+
23+
- name: Initialize WSL
24+
id: init_wsl
25+
uses: angular/dev-infra/github-actions/setup-wsl@9a3e28a515bf51cd2ecfd5f4d5b17613845e6f44
26+
with:
27+
wsl_firewall_interface: 'vEthernet (WSL (Hyper-V firewall))'
28+
29+
- name: Install node modules in WSL (re-using from previous install/cache restore)
30+
run: |
31+
cd ${{steps.init_wsl.outputs.repo_path}}
32+
yarn install --immutable
33+
shell: wsl-bash {0}
34+
35+
- name: Build test binary for Windows (inside WSL)
36+
shell: wsl-bash {0}
37+
run: |
38+
cd ${{steps.init_wsl.outputs.repo_path}}
39+
yarn bazel \
40+
build --config=e2e //tests/legacy-cli:${{inputs.test_target_name}} --platforms=tools:windows_x64
41+
env:
42+
# See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows
43+
WSLENV: 'GOOGLE_APPLICATION_CREDENTIALS/p'
44+
45+
- name: Copying binary artifact to host
46+
shell: wsl-bash {0}
47+
run: |
48+
cd ${{steps.init_wsl.outputs.repo_path}}
49+
tar -cf /tmp/test.tar.gz dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_
50+
mkdir /mnt/c/test
51+
mv /tmp/test.tar.gz /mnt/c/test
52+
(cd /mnt/c/test && tar -xf /mnt/c/test/test.tar.gz)
53+
54+
- name: Convert symlinks for Windows host
55+
shell: wsl-bash {0}
56+
run: |
57+
cd ${{steps.init_wsl.outputs.repo_path}}
58+
59+
runfiles_dir="/mnt/c/test/dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles"
60+
61+
# Make WSL symlinks compatible on Windows native file system.
62+
node scripts/windows-testing/convert-symlinks.mjs $runfiles_dir "${{steps.init_wsl.outputs.cmd_path}}"
63+
64+
# Needed for resolution.
65+
# TODO(devversion): consult with Aspect on why this is needed.
66+
(cd $runfiles_dir/angular_cli && ${{steps.init_wsl.outputs.cmd_path}} /C "mklink /D external ..")
67+
68+
- name: Run tests
69+
shell: bash # Note: This is Git Bash.
70+
env:
71+
BAZEL_BINDIR: '.'
72+
working-directory: "C:\\test"
73+
run: |
74+
node "${{github.workspace}}\\scripts\\windows-testing\\parallel-executor.mjs" \
75+
$PWD/dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles \
76+
${{inputs.test_target_name}} \
77+
"${{inputs.test_args}}" \

.github/workflows/ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ jobs:
8484
node: 20
8585
runs-on: ${{ matrix.os }}
8686
steps:
87-
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
88-
# TODO(devversion): Remove when Aspect lib issue is fixed.
89-
- run: choco install gzip
87+
- uses: Vampire/setup-wsl@v4
9088
if: ${{matrix.os == 'windows-latest'}}
9189
- name: Initialize environment
9290
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@836bdd0543d15904c469f5a0ce869d30a8029971
@@ -97,7 +95,7 @@ jobs:
9795
- name: Setup Bazel RBE
9896
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
9997
- name: Run CLI E2E tests
100-
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
98+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
10199

102100
e2e-package-managers:
103101
needs: test
@@ -119,7 +117,7 @@ jobs:
119117
- name: Setup Bazel RBE
120118
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
121119
- name: Run CLI E2E tests
122-
run: yarn bazel test --define=E2E_SHARD_TOTAL=3 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
120+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
123121

124122
e2e-snapshots:
125123
needs: test
@@ -141,7 +139,7 @@ jobs:
141139
- name: Setup Bazel RBE
142140
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
143141
- name: Run CLI E2E tests
144-
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
142+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
145143

146144
browsers:
147145
needs: build

.github/workflows/pr.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,25 +123,39 @@ jobs:
123123
- name: Setup Bazel RBE
124124
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
125125
- name: Run CLI E2E tests
126-
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
126+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
127127

128128
e2e-windows-subset:
129-
needs: build
130-
runs-on: windows-latest
129+
# needs: build
130+
runs-on: windows-2025
131131
steps:
132-
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
133-
# TODO(devversion): Remove when Aspect lib issue is fixed.
134-
- run: choco install gzip
135132
- name: Initialize environment
136-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@836bdd0543d15904c469f5a0ce869d30a8029971
137-
- name: Install node modules
138-
run: yarn install --immutable
139-
- name: Setup Bazel
140-
uses: angular/dev-infra/github-actions/bazel/setup@836bdd0543d15904c469f5a0ce869d30a8029971
141-
- name: Setup Bazel RBE
142-
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
133+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0000d926624b2fd918e93f1c6b5e2defba9af91f
134+
- name: Run CLI E2E tests
135+
uses: ./.github/shared-actions/windows-bazel-test
136+
with:
137+
test_target_name: e2e_node22
138+
test_args: --esbuild --glob "tests/basic/{build,rebuild}.ts"
139+
140+
e2e_windows:
141+
strategy:
142+
fail-fast: false
143+
matrix:
144+
os: [windows-2025]
145+
node: [22]
146+
subset: [npm, esbuild]
147+
shard: [0, 1, 2, 3, 4, 5]
148+
runs-on: ${{ matrix.os }}
149+
steps:
150+
- name: Initialize environment
151+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0000d926624b2fd918e93f1c6b5e2defba9af91f
143152
- name: Run CLI E2E tests
144-
run: yarn bazel test --config=e2e //tests/legacy-cli:e2e_node22 --test_filter="tests/basic/{build,rebuild}.ts" --test_arg="--esbuild"
153+
uses: ./.github/shared-actions/windows-bazel-test
154+
with:
155+
test_target_name: e2e.${{ matrix.subset }}_node${{ matrix.node }}
156+
env:
157+
E2E_SHARD_TOTAL: 6
158+
E2E_SHARD_INDEX: ${{ matrix.shard }}
145159

146160
e2e-package-managers:
147161
needs: build
@@ -163,7 +177,7 @@ jobs:
163177
- name: Setup Bazel RBE
164178
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
165179
- name: Run CLI E2E tests
166-
run: yarn bazel test --define=E2E_SHARD_TOTAL=3 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
180+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
167181

168182
e2e-snapshots:
169183
needs: [analyze, build]
@@ -186,4 +200,4 @@ jobs:
186200
- name: Setup Bazel RBE
187201
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
188202
- name: Run CLI E2E tests
189-
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
203+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}

WORKSPACE

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ workspace(name = "angular_cli")
22

33
DEFAULT_NODE_VERSION = "20.11.1"
44

5-
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
6-
# Override toolchain for tar on windows.
7-
register_toolchains(
8-
"//tools:windows_tar_system_toolchain",
9-
)
10-
115
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
126

137
http_archive(
@@ -145,13 +139,6 @@ aspect_bazel_lib_dependencies()
145139

146140
aspect_bazel_lib_register_toolchains()
147141

148-
register_toolchains(
149-
"@npm//@angular/build-tooling/bazel/git-toolchain:git_linux_toolchain",
150-
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_x86_toolchain",
151-
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_arm64_toolchain",
152-
"@npm//@angular/build-tooling/bazel/git-toolchain:git_windows_toolchain",
153-
)
154-
155142
load("@npm//@angular/build-tooling/bazel/browsers:browser_repositories.bzl", "browser_repositories")
156143

157144
browser_repositories()
@@ -205,6 +192,10 @@ npm_translate_lock(
205192
# for `rules_nodejs` dependencies :)
206193
},
207194
pnpm_lock = "//:pnpm-lock.yaml",
195+
public_hoist_packages = {
196+
# TODO: Remove when https://github.com/verdaccio/verdaccio/commit/bf0e09a509e8e0a74167b0307d129202bc3f40d2 is available.
197+
"@verdaccio/config": [""],
198+
},
208199
update_pnpm_lock = True,
209200
verify_node_modules_ignored = "//:.bazelignore",
210201
yarn_lock = "//:yarn.lock",
@@ -216,8 +207,6 @@ npm_repositories()
216207

217208
http_archive(
218209
name = "aspect_rules_ts",
219-
patch_args = ["-p1"],
220-
patches = ["//tools:rules_ts_windows.patch"],
221210
sha256 = "4263532b2fb4d16f309d80e3597191a1cb2fb69c19e95d91711bd6b97874705e",
222211
strip_prefix = "rules_ts-3.5.0",
223212
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.5.0/rules_ts-v3.5.0.tar.gz",
@@ -253,7 +242,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
253242

254243
git_repository(
255244
name = "devinfra",
256-
commit = "0ad6a370f70638e785d6ef1f90dc6ede34684a47",
245+
commit = "836bdd0543d15904c469f5a0ce869d30a8029971",
257246
remote = "https://github.com/angular/dev-infra.git",
258247
)
259248

@@ -264,3 +253,10 @@ setup_dependencies_1()
264253
load("@devinfra//bazel:setup_dependencies_2.bzl", "setup_dependencies_2")
265254

266255
setup_dependencies_2()
256+
257+
register_toolchains(
258+
"@devinfra//bazel/git-toolchain:git_linux_toolchain",
259+
"@devinfra//bazel/git-toolchain:git_macos_x86_toolchain",
260+
"@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain",
261+
"@devinfra//bazel/git-toolchain:git_windows_toolchain",
262+
)

goldens/BUILD.bazel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
2+
13
package(default_visibility = ["//visibility:public"])
24

3-
filegroup(
5+
copy_to_bin(
46
name = "public-api",
57
srcs = glob([
68
"public-api/**/*.md",

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
"homepage": "https://github.com/angular/angular-cli",
4444
"devDependencies": {
4545
"@ampproject/remapping": "2.3.0",
46-
"@angular/animations": "19.2.0",
47-
"@angular/bazel": "https://github.com/angular/bazel-builds.git#fdef2cfed1cb0ff6ee51d9edb88b5c78684a40ef",
48-
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a6a996a69cfc03b3fbe538f11dd24b7bc4b30592",
46+
"@angular/animations": "19.2.0-rc.0",
47+
"@angular/bazel": "https://github.com/angular/bazel-builds.git#58e1a344eed2dfea489cd290a4b4a963f7e3ac65",
48+
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#d4727212a9d0f7eb63ae3116d73c769d9bd0bdc1",
4949
"@angular/cdk": "19.2.1",
5050
"@angular/common": "19.2.0",
5151
"@angular/compiler": "19.2.0",
@@ -82,6 +82,7 @@
8282
"@listr2/prompt-adapter-inquirer": "2.0.18",
8383
"@rollup/plugin-alias": "^5.1.1",
8484
"@rollup/plugin-commonjs": "^28.0.0",
85+
"@rollup/plugin-json": "^6.1.0",
8586
"@rollup/plugin-node-resolve": "^13.0.5",
8687
"@stylistic/eslint-plugin": "^4.0.0",
8788
"@types/babel__core": "7.20.5",

packages/angular/build/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
1+
load("@@devinfra//bazel/api-golden:index_rjs.bzl", "api_golden_test_npm_package")
22
load("@npm2//:defs.bzl", "npm_link_all_packages")
33
load("//tools:defaults2.bzl", "copy_to_bin", "jasmine_test", "npm_package", "ts_project")
44
load("//tools:ts_json_schema.bzl", "ts_json_schema")
@@ -309,6 +309,6 @@ api_golden_test_npm_package(
309309
":npm_package",
310310
"//goldens:public-api",
311311
],
312-
golden_dir = "angular_cli/goldens/public-api/angular/build",
313-
npm_package = "angular_cli/packages/angular/build/npm_package",
312+
golden_dir = "goldens/public-api/angular/build",
313+
npm_package = "packages/angular/build/npm_package",
314314
)

packages/angular/ssr/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
2-
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
2+
load("@devinfra//bazel/api-golden:index_rjs.bzl", "api_golden_test_npm_package")
33
load("@npm2//:defs.bzl", "npm_link_all_packages")
44
load("@rules_pkg//:pkg.bzl", "pkg_tar")
55
load("//tools:defaults2.bzl", "ng_package", "ts_project")
@@ -90,6 +90,6 @@ api_golden_test_npm_package(
9090
":npm_package",
9191
"//goldens:public-api",
9292
],
93-
golden_dir = "angular_cli/goldens/public-api/angular/ssr",
94-
npm_package = "angular_cli/packages/angular/ssr/npm_package",
93+
golden_dir = "goldens/public-api/angular/ssr",
94+
npm_package = "packages/angular/ssr/npm_package",
9595
)

0 commit comments

Comments
 (0)