-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update dev-infra and rework windows native testing
As part of go/ng:windows-dev-future, we are changing how our infrastructure supports Windows build & testing. Clearly: - we will still support contributors on Windows, and we believe we will be improving and streamlining the experience here - we will continue testing the Angular CLI for our Windows users. We are aware of the many Windows users using the `ng` CLI. What is changing? We are no longer actively working towards a Bazel infrastructure that supports native Windows building and testing. There are currently two ways to contribute to Angular on Windows. That is via WSL, or via e.g. native Windows cmd.exe, with Git Bash on top. We acknowledge that the latter worked sometimes, but we also realize it very often breaks as nobody on our team uses, verifies it, and it introduces extra complexity because Bazel on Windows is quite disconnected from Linux/Mac (e.g. no sandboxing). Going forward, to improve our team's effectiveness, and improve our stability guarantees for Windows (and Windows contributors), we are actively discouraging the use of Git Bash for contributing to Angular; but instead ask for WSL to be used. I can speak as one of the few long-term team members that have worked on Windows (without WSL) most of my time, that WSL is great and the contributing experience is much smoother and also easier to "guide". It's a positive change because we won't be suggesting "two ways to contribute on Windows", where in reality one is very brittle and can break at any time! --- For testing of the Angular CLI: We will continue to maintain the capability to cross-compile via Bazel with Windows as the target platform. This allows us to build the e2e tests for Windows, and run them natively outside WSL to ensure native Windows `ng` CLI testing! This is what this change mostly does. Notably, two things are missing here and will be followed up: - caching of the e2e tests on Windows is not properly functioning yet. - caching of the WSL node modules + nvm is not working properly yet. Other than that, we are seeing very similar timing and results of the Windows tests, so this change unblocks our `rules_js` migration.
- Loading branch information
1 parent
c8c7318
commit 5fd1cb5
Showing
53 changed files
with
742 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: 'Native Windows Bazel e2e test' | ||
description: 'Runs an Angular CLI e2e Bazel test on native Windows (dispatched from inside WSL)' | ||
author: 'Angular' | ||
|
||
inputs: | ||
test_target_name: | ||
description: E2E test target name | ||
required: true | ||
test_args: | ||
description: | | ||
Text representing the command line arguments that | ||
should be passed to the e2e test runner. | ||
required: false | ||
default: '' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Bazel RBE | ||
uses: angular/dev-infra/github-actions/bazel/configure-remote@2667d139a421977a40c3ea7ec768609fb19a8b9d | ||
with: | ||
allow_windows_rbe: true | ||
|
||
- name: Initialize WSL | ||
id: init_wsl | ||
uses: angular/dev-infra/github-actions/setup-wsl@9a3e28a515bf51cd2ecfd5f4d5b17613845e6f44 | ||
with: | ||
wsl_firewall_interface: 'vEthernet (WSL (Hyper-V firewall))' | ||
|
||
- name: Install node modules in WSL (re-using from previous install/cache restore) | ||
run: | | ||
cd ${{steps.init_wsl.outputs.repo_path}} | ||
yarn install --immutable | ||
shell: wsl-bash {0} | ||
|
||
- name: Build test binary for Windows (inside WSL) | ||
shell: wsl-bash {0} | ||
run: | | ||
cd ${{steps.init_wsl.outputs.repo_path}} | ||
yarn bazel \ | ||
build --config=e2e //tests/legacy-cli:${{inputs.test_target_name}} --platforms=tools:windows_x64 | ||
env: | ||
# See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows | ||
WSLENV: 'GOOGLE_APPLICATION_CREDENTIALS/p' | ||
|
||
- name: Copying binary artifact to host | ||
shell: wsl-bash {0} | ||
run: | | ||
cd ${{steps.init_wsl.outputs.repo_path}} | ||
tar -cf /tmp/test.tar.gz dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_ | ||
mkdir /mnt/c/test | ||
mv /tmp/test.tar.gz /mnt/c/test | ||
(cd /mnt/c/test && tar -xf /mnt/c/test/test.tar.gz) | ||
- name: Convert symlinks for Windows host | ||
shell: wsl-bash {0} | ||
run: | | ||
cd ${{steps.init_wsl.outputs.repo_path}} | ||
runfiles_dir="/mnt/c/test/dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles" | ||
# Make WSL symlinks compatible on Windows native file system. | ||
node scripts/windows-testing/convert-symlinks.mjs $runfiles_dir "${{steps.init_wsl.outputs.cmd_path}}" | ||
# Needed for resolution because Aspect/Bazel looks for repositories at `<workspace>/external`. | ||
# TODO(devversion): consult with Aspect on why this is needed. | ||
(cd $runfiles_dir/angular_cli && ${{steps.init_wsl.outputs.cmd_path}} /C "mklink /D external ..") | ||
- name: Run tests | ||
# Note: This is Git Bash. | ||
shell: bash | ||
env: | ||
BAZEL_BINDIR: '.' | ||
working-directory: "C:\\test" | ||
run: | | ||
node "${{github.workspace}}\\scripts\\windows-testing\\parallel-executor.mjs" \ | ||
$PWD/dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles \ | ||
${{inputs.test_target_name}} \ | ||
"${{inputs.test_args}}" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.