Skip to content

Commit e67d7d6

Browse files
committed
build: update dev-infra and rework windows native testing
TODO
1 parent 2f8e7db commit e67d7d6

Some content is hidden

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

46 files changed

+521
-209
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=-945739255
6+
package.json=1763678112
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=605871936
1919
packages/schematics/angular/package.json=251715148
20-
pnpm-lock.yaml=451428255
20+
pnpm-lock.yaml=-1859463949
2121
pnpm-workspace.yaml=-1264044456
2222
tests/package.json=700948366
23-
yarn.lock=305179493
23+
yarn.lock=-2001987312

.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: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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
19+
uses: angular/dev-infra/github-actions/bazel/setup@b015169b635123c1ab9084f604e36b6342eac171
20+
- name: Setup Bazel RBE
21+
uses: angular/dev-infra/github-actions/bazel/configure-remote@2667d139a421977a40c3ea7ec768609fb19a8b9d
22+
with:
23+
allow_windows_rbe: true
24+
25+
- name: Initialize WSL
26+
id: init_wsl
27+
uses: angular/dev-infra/github-actions/setup-wsl@e32a8061e4cad40f3e7fcb154e4cc25f6a59b21d
28+
with:
29+
wsl_firewall_interface: 'vEthernet (WSL (Hyper-V firewall))'
30+
31+
- name: Install node modules in WSL (re-using from previous install/cache restore)
32+
run: yarn install --immutable
33+
working-directory: ${{steps.init_wsl.outputs.repo_path}}
34+
shell: wsl-bash {0}
35+
36+
- name: Build test binary for Windows (inside WSL)
37+
shell: wsl-bash {0}
38+
working-directory: ${{steps.init_wsl.outputs.repo_path}}
39+
run: |
40+
yarn bazel \
41+
build --config=e2e //tests/legacy-cli:${{inputs.test_target_name}} --platforms=tools:windows_x64
42+
env:
43+
# See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows
44+
WSLENV: 'GOOGLE_APPLICATION_CREDENTIALS/p'
45+
46+
- name: Convert symlinks for Windows host
47+
shell: wsl-bash {0}
48+
working-directory: ${{steps.init_wsl.outputs.repo_path}}
49+
run: |
50+
chmod u+w -R dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_
51+
node scripts/windows-testing/convert-symlinks.mjs \
52+
dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles \
53+
"${{steps.init_wsl.outputs.cmd_path}}"
54+
55+
- name: Run tests
56+
shell: bash # Note: This is Git Bash.
57+
env:
58+
BAZEL_BINDIR: '.'
59+
working-directory: ${{steps.init_wsl.outputs.repo_path}}
60+
run: |
61+
cd dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles/angular_cli
62+
../../${{inputs.test_target_name}} ${{inputs.test_args}}

.github/workflows/ci.yml

Lines changed: 1 addition & 3 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@b3240b00315baa96f1b2deea2f71315f870dbb43

.github/workflows/pr.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,36 @@ jobs:
126126
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 }}
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@b3240b00315baa96f1b2deea2f71315f870dbb43
137-
- name: Install node modules
138-
run: yarn install --immutable
139-
- name: Setup Bazel
140-
uses: angular/dev-infra/github-actions/bazel/setup@b3240b00315baa96f1b2deea2f71315f870dbb43
141-
- name: Setup Bazel RBE
142-
uses: angular/dev-infra/github-actions/bazel/configure-remote@b3240b00315baa96f1b2deea2f71315f870dbb43
133+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0000d926624b2fd918e93f1c6b5e2defba9af91f
143134
- 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"
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@d16848fd2ed19fce59488b540fa26a3353c72ad4
152+
# - name: Run CLI E2E tests
153+
# uses: ./.github/shared-actions/windows-bazel-test
154+
# with:
155+
# command: |
156+
# yarn bazel test \
157+
# --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} \
158+
# --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} \
145159

146160
e2e-package-managers:
147161
needs: build

WORKSPACE

Lines changed: 14 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,12 @@ npm_translate_lock(
205192
# for `rules_nodejs` dependencies :)
206193
},
207194
pnpm_lock = "//:pnpm-lock.yaml",
195+
public_hoist_packages = {
196+
# Pino of Verdaccio can't be bundled, so we make it loadable as runtime dep.
197+
"pino": [""],
198+
# See: https://github.com/verdaccio/verdaccio/pull/5101
199+
"@verdaccio/logger-prettify": [""],
200+
},
208201
update_pnpm_lock = True,
209202
verify_node_modules_ignored = "//:.bazelignore",
210203
yarn_lock = "//:yarn.lock",
@@ -216,8 +209,6 @@ npm_repositories()
216209

217210
http_archive(
218211
name = "aspect_rules_ts",
219-
patch_args = ["-p1"],
220-
patches = ["//tools:rules_ts_windows.patch"],
221212
sha256 = "4263532b2fb4d16f309d80e3597191a1cb2fb69c19e95d91711bd6b97874705e",
222213
strip_prefix = "rules_ts-3.5.0",
223214
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.5.0/rules_ts-v3.5.0.tar.gz",
@@ -253,7 +244,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
253244

254245
git_repository(
255246
name = "devinfra",
256-
commit = "0ad6a370f70638e785d6ef1f90dc6ede34684a47",
247+
commit = "0f920f422b8bbf1ca96a72cf01e18b95e266dc98",
257248
remote = "https://github.com/angular/dev-infra.git",
258249
)
259250

@@ -264,3 +255,10 @@ setup_dependencies_1()
264255
load("@devinfra//bazel:setup_dependencies_2.bzl", "setup_dependencies_2")
265256

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

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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"devDependencies": {
4545
"@ampproject/remapping": "2.3.0",
4646
"@angular/animations": "19.2.0-rc.0",
47-
"@angular/bazel": "https://github.com/angular/bazel-builds.git#17b980a15a1adbff7f09dfad04236abadaa6cbe5",
48-
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a6a996a69cfc03b3fbe538f11dd24b7bc4b30592",
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.0-rc.0",
5050
"@angular/common": "19.2.0-rc.0",
5151
"@angular/compiler": "19.2.0-rc.0",
@@ -79,6 +79,7 @@
7979
"@listr2/prompt-adapter-inquirer": "2.0.18",
8080
"@rollup/plugin-alias": "^5.1.1",
8181
"@rollup/plugin-commonjs": "^28.0.0",
82+
"@rollup/plugin-json": "^6.1.0",
8283
"@rollup/plugin-node-resolve": "^13.0.5",
8384
"@stylistic/eslint-plugin": "^3.0.0",
8485
"@types/babel__core": "7.20.5",

packages/angular/build/BUILD.bazel

Lines changed: 1 addition & 1 deletion
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")

packages/ngtools/webpack/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Use of this source code is governed by an MIT-style license that can be
44
# found in the LICENSE file at https://angular.dev/license
55

6-
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
6+
load("@devinfra//bazel/api-golden:index_rjs.bzl", "api_golden_test_npm_package")
77
load("@npm2//:defs.bzl", "npm_link_all_packages")
88
load("//tools:defaults2.bzl", "jasmine_test", "npm_package", "ts_project")
99

0 commit comments

Comments
 (0)