Skip to content

Commit 17875c2

Browse files
committed
build: experiment with windows testingt pusht
1 parent e6deb82 commit 17875c2

File tree

17 files changed

+261
-135
lines changed

17 files changed

+261
-135
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: 74 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,89 @@ 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
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
132+
# Git checkout converts to CRLF by default. This causes the Aspect lock
133+
# files to differ. See: https://github.com/actions/checkout/issues/135.
134+
- run: |
135+
git config --system core.autocrlf false
136+
git config --system core.eol lf
135137
- name: Initialize environment
136138
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b015169b635123c1ab9084f604e36b6342eac171
137139
- name: Install node modules
138140
run: yarn install --immutable
139141
- name: Setup Bazel
140142
uses: angular/dev-infra/github-actions/bazel/setup@b015169b635123c1ab9084f604e36b6342eac171
141143
- name: Setup Bazel RBE
142-
uses: angular/dev-infra/github-actions/bazel/configure-remote@b015169b635123c1ab9084f604e36b6342eac171
144+
uses: angular/dev-infra/github-actions/bazel/configure-remote@a5e90c88a0fc012de199fe6f148c12b5476d6d1b
145+
146+
- name: Setup tmate session
147+
uses: mxschmitt/action-tmate@v3
148+
with:
149+
detached: true
150+
151+
- uses: Vampire/setup-wsl@v4
152+
with:
153+
wsl-conf: |
154+
[interop]
155+
appendWindowsPath=false
156+
[wsl2]
157+
networkingMode=mirrored
158+
kernelCommandLine=ipv6.disable=1
159+
wsl-shell-command: bash --login -euo pipefail
160+
additional-packages: |
161+
curl
162+
ca-certificates
163+
g++
164+
unzip
165+
zip
166+
git
167+
python3
168+
tar
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+
- run: npm install -g yarn@1
179+
shell: wsl-bash {0}
180+
- name: Install node modules in WSL (re-using from previous install/cache restore)
181+
run: yarn install --immutable
182+
shell: wsl-bash {0}
183+
- name: Determining paths for WSL usage
184+
id: wsl_paths
185+
run: |
186+
cmd_path=$(which cmd.exe)
187+
cmd_wsl_path=$(wsl exec wslpath -u $cmd_path)
188+
echo "cmd_path=$cmd_wsl_path" >> $GITHUB_OUTPUT
189+
190+
npm_path=$(which npm)
191+
npm_wls_path=$(wsl exec wslpath -u $npm_path)
192+
echo "npm_path=$npm_wls_path" >> $GITHUB_OUTPUT
193+
- name: Create link to WSL drive
194+
shell: powershell
195+
run: New-Item -ItemType SymbolicLink -Path "C:\wsl_root" -Target "\\wsl.localhost\Debian"
143196
- 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"
197+
env:
198+
# See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows
199+
WSLENV: 'GOOGLE_APPLICATION_CREDENTIALS/p'
200+
run: |
201+
yarn bazel test \
202+
--config=e2e //tests/legacy-cli:e2e_node22 \
203+
--test_filter="tests/basic/{build,rebuild}.ts" \
204+
--test_arg="--esbuild" \
205+
--test_env="NG_E2E_RUNNER_WSL_ROOT=C:\wsl_root" \
206+
--test_env="NG_E2E_RUNNER_WSL_UNC_BASE=\\wsl.localhost\Debian" \
207+
--test_env="NG_E2E_RUNNER_WINDOWS_CMD=${{steps.wsl_paths.outputs.cmd_path}}" \
208+
--test_env="NG_E2E_RUNNER_WINDOWS_NPM=${{steps.wsl_paths.outputs.npm_path}}" \
209+
--test_output=streamed \
210+
--spawn_strategy=local
211+
shell: wsl-bash {0}
145212

146213
e2e-package-managers:
147214
needs: build
@@ -161,7 +228,7 @@ jobs:
161228
- name: Setup Bazel
162229
uses: angular/dev-infra/github-actions/bazel/setup@b015169b635123c1ab9084f604e36b6342eac171
163230
- name: Setup Bazel RBE
164-
uses: angular/dev-infra/github-actions/bazel/configure-remote@b015169b635123c1ab9084f604e36b6342eac171
231+
uses: angular/dev-infra/github-actions/bazel/configure-remote@3bfa6d8c9861c6477a52146828382a3d5043005f
165232
- name: Run CLI E2E tests
166233
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 }}
167234

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: 35 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,23 @@ 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+
windows_node_files = [
131+
"@%s//:node_files" % windows_node_repo,
132+
"@%s//:npm_files" % windows_node_repo,
133+
"@%s//:bin/npm.cmd" % windows_node_repo,
134+
]
135+
136+
data = select({
137+
"@bazel_tools//src/conditions:windows": data + windows_node_files,
138+
"//conditions:default": data + windows_node_files,
139+
#"//conditions:default": data,
140+
})
141+
142+
env.update({
143+
"NG_E2E_WINDOWS_REPO_SHORT_PATH": "../%s" % windows_node_repo,
144+
})
145+
122146
nodejs_test(
123147
name = name,
124148
templated_args = args,
@@ -131,7 +155,7 @@ def _e2e_tests(name, runner, **kwargs):
131155
**kwargs
132156
)
133157

134-
def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None):
158+
def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None, windows_node_repo = None):
135159
"""
136160
Setup a predefined test suite (yarn|pnpm|bun|esbuild|saucelabs|npm).
137161
"""
@@ -166,6 +190,7 @@ def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None):
166190
size = "enormous",
167191
data = data,
168192
toolchain = toolchain,
193+
windows_node_repo = windows_node_repo,
169194
shard_count = TEST_SHARD_COUNT,
170195
templated_args = args + [
171196
"--glob=%s" % _to_glob(tests) if tests else "",
@@ -180,6 +205,7 @@ def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None):
180205
size = "enormous",
181206
data = data,
182207
toolchain = toolchain,
208+
windows_node_repo = windows_node_repo,
183209
shard_count = TEST_SHARD_COUNT,
184210
templated_args = args + [
185211
"--ng-snapshots",

tests/legacy-cli/e2e/setup/010-local-publish.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ export default async function () {
1919
// Publish packages specified with --package
2020
await Promise.all(
2121
packageTars.map(({ path: p }) =>
22-
globalNpm(['publish', '--tag', isPrereleaseCli() ? 'next' : 'latest', p], {
23-
...extractNpmEnv(),
24-
'NPM_CONFIG_USERCONFIG': npmrc,
25-
}),
22+
fetch(testRegistry)
23+
.then((t) => t.text())
24+
.then((t) => console.error('Text: ', t))
25+
.then(() =>
26+
globalNpm(['publish', '--tag', isPrereleaseCli() ? 'next' : 'latest', p], {
27+
...extractNpmEnv(),
28+
'NPM_CONFIG_USERCONFIG': npmrc,
29+
}).then(() => console.log('Package published!!!!!', p)),
30+
),
2631
),
2732
);
2833
}

0 commit comments

Comments
 (0)