Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-1406867100
modules/testing/builder/package.json=973445093
package.json=-149318065
package.json=1846598446
packages/angular/build/package.json=1250379839
packages/angular/cli/package.json=-1917515334
packages/angular/pwa/package.json=1108903917
Expand All @@ -17,7 +17,7 @@ packages/angular_devkit/schematics/package.json=673943597
packages/angular_devkit/schematics_cli/package.json=-2026655035
packages/ngtools/webpack/package.json=605871936
packages/schematics/angular/package.json=251715148
pnpm-lock.yaml=1642270121
pnpm-lock.yaml=-141123385
pnpm-workspace.yaml=-1264044456
tests/package.json=700948366
yarn.lock=1260513060
yarn.lock=1519724203
8 changes: 0 additions & 8 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ test:no-sharding --flaky_test_attempts=1 --test_sharding_strategy=disabled
# See https://github.com/bazelbuild/bazel/issues/4603
build --symlink_prefix=dist/

# Disable watchfs as it causes tests to be flaky on Windows
# https://github.com/angular/angular/issues/29541
build --nowatchfs

# Turn off legacy external runfiles
build --nolegacy_external_runfiles

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

# Enable runfiles even on Windows.
# Architect resolves output files from data files, and this isn't possible without runfile support.
build --enable_runfiles

####################################################
# rules_js specific flags
####################################################
Expand Down
52 changes: 52 additions & 0 deletions .github/shared-actions/windows-bazel-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'Native Windows Bazel e2e test'
description: 'Runs an Angular CLI e2e Bazel test on native Windows (dispatched from inside WSL)'
author: 'Angular'

inputs:
command:
description: |
Shell command to run the Bazel test. When multi-line, needs to end with
a trailing `\` to allow for the extra added that enable running the
WSL native Windows test.
required: true

runs:
using: composite
steps:
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@b015169b635123c1ab9084f604e36b6342eac171
- 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@0000d926624b2fd918e93f1c6b5e2defba9af91f
with:
wsl_firewall_interface: 'vEthernet (WSL (Hyper-V firewall))'

- name: Install node modules in WSL (re-using from previous install/cache restore)
run: yarn install --immutable
shell: wsl-bash {0}

# Notes for below command:
# * strategy=TestRunner: Needed as we will create files outside of the WSL-bound sandbox.
# * symlink_prefix=/: Needed as otherwise we will create unix symlinks in the Windows host.
- run: |
${{inputs.command}} \
--//tests/legacy-cli:enable_native_windows_testing=true \
--test_env="NG_E2E_RUNNER_WSL_ROOT=${{steps.init_wsl.outputs.wsl_root_path}}" \
--test_env="NG_E2E_RUNNER_WSL_UNC_BASE=${{steps.init_wsl.outputs.wsl_root_unc_path}}" \
--test_env="NG_E2E_RUNNER_WINDOWS_CMD=${{steps.init_wsl.outputs.cmd_path}}" \
--test_env="NG_E2E_RUNNER_WINDOWS_NPM=${{steps.init_wsl.outputs.npm_path}}" \
--test_env="NG_E2E_RUNNER_WINDOWS_TMP_DIR=${{steps.init_wsl.outputs.tmp_path}}" \
--test_env="NG_E2E_RUNNER_WINDOWS_GIT_BASH_BIN=${{steps.init_wsl.outputs.git_path}}" \
--test_env="NG_E2E_RUNNER_WSL_HOST_ADDR=$(ip route show | grep -i default | awk '{ print $3}')" \
--test_env="NG_E2E_RUNNER_WSL_VM_ADDR=$(hostname -I)" \
--strategy=TestRunner=standalone \
--symlink_prefix=/
shell: wsl-bash {0}
env:
# See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows
WSLENV: 'GOOGLE_APPLICATION_CREDENTIALS/p'
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ jobs:
node: 20
runs-on: ${{ matrix.os }}
steps:
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
# TODO(devversion): Remove when Aspect lib issue is fixed.
- run: choco install gzip
- uses: Vampire/setup-wsl@v4
if: ${{matrix.os == 'windows-latest'}}
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0ad6a370f70638e785d6ef1f90dc6ede34684a47
Expand Down
44 changes: 30 additions & 14 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,38 @@ jobs:
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 }}

e2e-windows-subset:
needs: build
runs-on: windows-latest
# needs: build
runs-on: windows-2025
steps:
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
# TODO(devversion): Remove when Aspect lib issue is fixed.
- run: choco install gzip
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0ad6a370f70638e785d6ef1f90dc6ede34684a47
- name: Install node modules
run: yarn install --immutable
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@0ad6a370f70638e785d6ef1f90dc6ede34684a47
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@0ad6a370f70638e785d6ef1f90dc6ede34684a47
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@d16848fd2ed19fce59488b540fa26a3353c72ad4
- name: Run CLI E2E tests
uses: ./.github/shared-actions/windows-bazel-test
with:
command: |
yarn bazel test --config=e2e //tests/legacy-cli:e2e_node22 \
--test_filter="tests/basic/{build,rebuild}.ts" \
--test_arg="--esbuild" \

e2e_windows:
strategy:
fail-fast: false
matrix:
os: [windows-2025]
node: [22]
subset: [npm, esbuild]
shard: [0, 1, 2, 3, 4, 5]
runs-on: ${{ matrix.os }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@d16848fd2ed19fce59488b540fa26a3353c72ad4
- name: Run CLI E2E tests
run: yarn bazel test --config=e2e //tests/legacy-cli:e2e_node22 --test_filter="tests/basic/{build,rebuild}.ts" --test_arg="--esbuild"
uses: ./.github/shared-actions/windows-bazel-test
with:
command: |
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 }} \

e2e-package-managers:
needs: build
Expand All @@ -161,7 +177,7 @@ jobs:
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@0ad6a370f70638e785d6ef1f90dc6ede34684a47
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@0ad6a370f70638e785d6ef1f90dc6ede34684a47
uses: angular/dev-infra/github-actions/bazel/configure-remote@3bfa6d8c9861c6477a52146828382a3d5043005f
- name: Run CLI E2E tests
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 }}

Expand Down
9 changes: 0 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ workspace(name = "angular_cli")

DEFAULT_NODE_VERSION = "20.11.1"

# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
# Override toolchain for tar on windows.
register_toolchains(
"//tools:windows_tar_system_toolchain",
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")

http_archive(
Expand Down Expand Up @@ -149,7 +143,6 @@ register_toolchains(
"@npm//@angular/build-tooling/bazel/git-toolchain:git_linux_toolchain",
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_x86_toolchain",
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_arm64_toolchain",
"@npm//@angular/build-tooling/bazel/git-toolchain:git_windows_toolchain",
)

load("@npm//@angular/build-tooling/bazel/browsers:browser_repositories.bzl", "browser_repositories")
Expand Down Expand Up @@ -216,8 +209,6 @@ npm_repositories()

http_archive(
name = "aspect_rules_ts",
patch_args = ["-p1"],
patches = ["//tools:rules_ts_windows.patch"],
sha256 = "4263532b2fb4d16f309d80e3597191a1cb2fb69c19e95d91711bd6b97874705e",
strip_prefix = "rules_ts-3.5.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.5.0/rules_ts-v3.5.0.tar.gz",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@ampproject/remapping": "2.3.0",
"@angular/animations": "19.2.0-rc.0",
"@angular/bazel": "https://github.com/angular/bazel-builds.git#58e1a344eed2dfea489cd290a4b4a963f7e3ac65",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a6a996a69cfc03b3fbe538f11dd24b7bc4b30592",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#d4727212a9d0f7eb63ae3116d73c769d9bd0bdc1",
"@angular/cdk": "19.2.0-rc.0",
"@angular/common": "19.2.0-rc.0",
"@angular/compiler": "19.2.0-rc.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { count, debounceTime, finalize, switchMap, take, timeout } from 'rxjs';
import { executeDevServer } from '../../index';
import { describeServeBuilder } from '../jasmine-helpers';
import { BASE_OPTIONS, BUILD_TIMEOUT, DEV_SERVER_BUILDER_INFO } from '../setup';
import { loopbackAddr } from '../../../../../../../../tests/legacy-cli/e2e/utils/env';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const document: any;
Expand Down Expand Up @@ -102,7 +103,7 @@ async function createProxy(target: string, secure: boolean, ws = true): Promise<

return {
server,
url: `${secure ? 'https' : 'http'}://localhost:${proxyPort}`,
url: `${secure ? 'https' : 'http'}://${loopbackAddr}:${proxyPort}`,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { count, debounceTime, finalize, switchMap, take, timeout } from 'rxjs';
import { executeDevServer } from '../../index';
import { describeServeBuilder } from '../jasmine-helpers';
import { BASE_OPTIONS, BUILD_TIMEOUT, DEV_SERVER_BUILDER_INFO } from '../setup';
import { loopbackAddr } from '../../../../../../../../tests/legacy-cli/e2e/utils/env';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const document: any;
Expand Down Expand Up @@ -102,7 +103,7 @@ async function createProxy(target: string, secure: boolean, ws = true): Promise<

return {
server,
url: `${secure ? 'https' : 'http'}://localhost:${proxyPort}`,
url: `${secure ? 'https' : 'http'}://${loopbackAddr}:${proxyPort}`,
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.dev/license

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

Expand Down
13 changes: 7 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set -e

yarn bazel test \
--define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=2 \
--//tests/legacy-cli:enable_native_windows_testing=true \
--config=e2e //tests/legacy-cli:e2e.esbuild_node22 \
--test_arg="--esbuild" \
--test_env="NG_E2E_RUNNER_WSL_ROOT=C:\wsl_root" \
--test_env="NG_E2E_RUNNER_WSL_UNC_BASE=\\\\wsl.localhost\Debian" \
--test_env="NG_E2E_RUNNER_WINDOWS_CMD=/mnt/c/Windows/system32/cmd.exe" \
--test_env="NG_E2E_RUNNER_WINDOWS_NPM=C:\Program Files\nodejs\npm" \
--test_env="NG_E2E_RUNNER_WINDOWS_TMP_DIR=/mnt/c/Users/paulg/AppData/Local/Temp" \
--test_env="NG_E2E_RUNNER_WINDOWS_GIT_BASH_BIN=/mnt/c/Program Files/Git/bin/git" \
--test_env="NG_E2E_RUNNER_WSL_HOST_ADDR=$(ip route show | grep -i default | awk '{ print $3}')" \
--test_env="NG_E2E_RUNNER_WSL_VM_ADDR=$(hostname -I)" \
--test_output=streamed \
--flaky_test_attempts=1 \
--strategy=TestRunner=standalone
13 changes: 13 additions & 0 deletions tests/legacy-cli/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("//tools:interop.bzl", "ts_project")
load(":e2e.bzl", "e2e_suites")

bool_flag(
name = "enable_native_windows_testing",
build_setting_default = False,
)

config_setting(
name = "native_windows_testing",
flag_values = {
":enable_native_windows_testing": "true",
},
)

ts_project(
name = "runner",
testonly = True,
Expand Down
Loading
Loading