Skip to content

Commit 350eb34

Browse files
committed
build: experiment with windows testingt push
1 parent e6deb82 commit 350eb34

File tree

14 files changed

+180
-128
lines changed

14 files changed

+180
-128
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=-1990485513
6+
package.json=1554529784
77
packages/angular/build/package.json=-1875938558
88
packages/angular/cli/package.json=-803141029
99
packages/angular/pwa/package.json=1108903917
@@ -17,6 +17,6 @@ packages/angular_devkit/schematics/package.json=673943597
1717
packages/angular_devkit/schematics_cli/package.json=774399812
1818
packages/ngtools/webpack/package.json=1021868664
1919
packages/schematics/angular/package.json=251715148
20-
pnpm-lock.yaml=543305912
20+
pnpm-lock.yaml=1923723008
2121
pnpm-workspace.yaml=-1056556036
22-
yarn.lock=-1771973873
22+
yarn.lock=590940374

.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
####################################################

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ jobs:
8787
node: 20
8888
runs-on: ${{ matrix.os }}
8989
steps:
90-
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
91-
# TODO(devversion): Remove when Aspect lib issue is fixed.
92-
- run: choco install gzip
90+
- uses: Vampire/setup-wsl@v4
9391
if: ${{matrix.os == 'windows-latest'}}
9492
- name: Initialize environment
9593
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b015169b635123c1ab9084f604e36b6342eac171

.github/workflows/pr.yml

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,72 @@ 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
129+
# needs: build
130130
runs-on: windows-latest
131+
env:
132+
# See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows
133+
WSLENV: 'GOOGLE_APPLICATION_CREDENTIALS/p'
131134
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
135+
# Git checkout converts to CRLF by default. This causes the Aspect lock
136+
# files to differ. See: https://github.com/actions/checkout/issues/135.
137+
- run: |
138+
git config --system core.autocrlf false
139+
git config --system core.eol lf
135140
- name: Initialize environment
136141
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b015169b635123c1ab9084f604e36b6342eac171
137142
- name: Install node modules
138143
run: yarn install --immutable
139144
- name: Setup Bazel
140145
uses: angular/dev-infra/github-actions/bazel/setup@b015169b635123c1ab9084f604e36b6342eac171
141146
- name: Setup Bazel RBE
142-
uses: angular/dev-infra/github-actions/bazel/configure-remote@b015169b635123c1ab9084f604e36b6342eac171
147+
uses: angular/dev-infra/github-actions/bazel/configure-remote@a5e90c88a0fc012de199fe6f148c12b5476d6d1b
148+
with:
149+
# We don't want to execute remotely, but instead execute tests locally when necessary.
150+
only_cache: true
151+
152+
- name: Setup tmate session
153+
uses: mxschmitt/action-tmate@v3
154+
with:
155+
detached: true
156+
157+
- uses: Vampire/setup-wsl@v4
158+
with:
159+
additional-packages: |
160+
curl
161+
ca-certificates
162+
g++
163+
unzip
164+
zip
165+
git
166+
python3
167+
tar
168+
wsl-shell-command: bash --login -euo pipefail
169+
- name: Setup nvm
170+
shell: wsl-bash {0}
171+
run: |
172+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
173+
export NVM_DIR="$HOME/.nvm"
174+
# Note: Specify `--install` due to https://github.com/nvm-sh/nvm/issues/1985.
175+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --install
176+
- run: nvm install
177+
shell: wsl-bash {0}
178+
- name: Install node modules in WSL (re-using from previous install/cache restore)
179+
run: yarn install --immutable
180+
shell: wsl-bash {0}
181+
- name: Determining cmd.exe path for WSL usage
182+
id: cmd_path
183+
run: |
184+
cmd_path=$(which cmd.exe)
185+
cmd_wsl_path=$(wsl exec wslpath -u $cmd_path)
186+
echo "result=$cmd_wsl_path" >> $GITHUB_OUTPUT
143187
- 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"
188+
run: |
189+
yarn bazel test --config=e2e //tests/legacy-cli:e2e_node22 \
190+
--test_filter="tests/basic/{build,rebuild}.ts" \
191+
--test_arg="--esbuild" \
192+
--test_env="NG_E2E_RUNNER_USE_WINDOWS_CMD=${{steps.cmd_path.outputs.result}}" \
193+
--test_output=streamed
194+
shell: wsl-bash {0}
145195

146196
e2e-package-managers:
147197
needs: build
@@ -161,7 +211,7 @@ jobs:
161211
- name: Setup Bazel
162212
uses: angular/dev-infra/github-actions/bazel/setup@b015169b635123c1ab9084f604e36b6342eac171
163213
- name: Setup Bazel RBE
164-
uses: angular/dev-infra/github-actions/bazel/configure-remote@b015169b635123c1ab9084f604e36b6342eac171
214+
uses: angular/dev-infra/github-actions/bazel/configure-remote@3bfa6d8c9861c6477a52146828382a3d5043005f
165215
- name: Run CLI E2E tests
166216
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 }}
167217

WORKSPACE

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

33
DEFAULT_NODE_VERSION = "18.19.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(
@@ -164,7 +158,6 @@ register_toolchains(
164158
"@npm//@angular/build-tooling/bazel/git-toolchain:git_linux_toolchain",
165159
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_x86_toolchain",
166160
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_arm64_toolchain",
167-
"@npm//@angular/build-tooling/bazel/git-toolchain:git_windows_toolchain",
168161
)
169162

170163
load("@npm//@angular/build-tooling/bazel/browsers:browser_repositories.bzl", "browser_repositories")
@@ -230,8 +223,6 @@ npm_repositories()
230223

231224
http_archive(
232225
name = "aspect_rules_ts",
233-
patch_args = ["-p1"],
234-
patches = ["//tools:rules_ts_windows.patch"],
235226
sha256 = "4263532b2fb4d16f309d80e3597191a1cb2fb69c19e95d91711bd6b97874705e",
236227
strip_prefix = "rules_ts-3.5.0",
237228
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.5.0/rules_ts-v3.5.0.tar.gz",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@ampproject/remapping": "2.3.0",
4646
"@angular/animations": "19.2.0-next.2",
4747
"@angular/bazel": "https://github.com/angular/bazel-builds.git#cee20fd0958b532ee7c48a5859b682fb5573b2ce",
48-
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a6a996a69cfc03b3fbe538f11dd24b7bc4b30592",
48+
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#d4727212a9d0f7eb63ae3116d73c769d9bd0bdc1",
4949
"@angular/cdk": "19.2.0-next.4",
5050
"@angular/common": "19.2.0-next.2",
5151
"@angular/compiler": "19.2.0-next.2",

pnpm-lock.yaml

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/legacy-cli/e2e.bzl

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,25 @@ def e2e_suites(name, runner, data):
7171
"""
7272

7373
# Pre-configured test suites
74-
for toolchain_name, toolchain in zip(
74+
for toolchain_name, (toolchain, windows_node_repo) in zip(
7575
TOOLCHAINS_NAMES,
7676
TOOLCHAINS_VERSIONS,
7777
):
7878
# Default target meant to be run manually for debugging, customizing test cli via bazel
79-
_e2e_tests(name + "_" + toolchain_name, runner, data = data, toolchain = toolchain, tags = ["manual"])
80-
81-
_e2e_suite(name, runner, "npm", data, toolchain_name, toolchain)
82-
_e2e_suite(name, runner, "bun", data, toolchain_name, toolchain)
83-
_e2e_suite(name, runner, "pnpm", data, toolchain_name, toolchain)
84-
_e2e_suite(name, runner, "yarn", data, toolchain_name, toolchain)
85-
_e2e_suite(name, runner, "esbuild", data, toolchain_name, toolchain)
79+
_e2e_tests(
80+
name + "_" + toolchain_name,
81+
runner,
82+
data = data,
83+
toolchain = toolchain,
84+
windows_node_repo = windows_node_repo,
85+
tags = ["manual"],
86+
)
87+
88+
_e2e_suite(name, runner, "npm", data, toolchain_name, toolchain, windows_node_repo)
89+
_e2e_suite(name, runner, "bun", data, toolchain_name, toolchain, windows_node_repo)
90+
_e2e_suite(name, runner, "pnpm", data, toolchain_name, toolchain, windows_node_repo)
91+
_e2e_suite(name, runner, "yarn", data, toolchain_name, toolchain, windows_node_repo)
92+
_e2e_suite(name, runner, "esbuild", data, toolchain_name, toolchain, windows_node_repo)
8693

8794
# Saucelabs tests are only run on the default toolchain
8895
_e2e_suite(name, runner, "saucelabs", data)
@@ -119,6 +126,18 @@ def _e2e_tests(name, runner, **kwargs):
119126
toolchains = toolchains + ["@npm//@angular/build-tooling/bazel/browsers/chromium:toolchain_alias"]
120127
data = data + ["@npm//@angular/build-tooling/bazel/browsers/chromium"]
121128

129+
windows_node_repo = kwargs.pop("windows_node_repo", None)
130+
131+
data = select({
132+
"@bazel_tools//src/conditions:windows": data + ["@%s//:node_files" % windows_node_repo],
133+
"//conditions:default": data + ["@%s//:node_files" % windows_node_repo],
134+
#"//conditions:default": data,
135+
})
136+
137+
env.update({
138+
"NG_E2E_WINDOWS_NODE_SHORT_PATH": "../%s" % windows_node_repo,
139+
})
140+
122141
nodejs_test(
123142
name = name,
124143
templated_args = args,
@@ -131,7 +150,7 @@ def _e2e_tests(name, runner, **kwargs):
131150
**kwargs
132151
)
133152

134-
def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None):
153+
def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None, windows_node_repo = None):
135154
"""
136155
Setup a predefined test suite (yarn|pnpm|bun|esbuild|saucelabs|npm).
137156
"""
@@ -166,6 +185,7 @@ def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None):
166185
size = "enormous",
167186
data = data,
168187
toolchain = toolchain,
188+
windows_node_repo = windows_node_repo,
169189
shard_count = TEST_SHARD_COUNT,
170190
templated_args = args + [
171191
"--glob=%s" % _to_glob(tests) if tests else "",
@@ -180,6 +200,7 @@ def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None):
180200
size = "enormous",
181201
data = data,
182202
toolchain = toolchain,
203+
windows_node_repo = windows_node_repo,
183204
shard_count = TEST_SHARD_COUNT,
184205
templated_args = args + [
185206
"--ng-snapshots",

0 commit comments

Comments
 (0)