From 321714e5de38a6b592793ed804e705f8ade1017a Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 1 Nov 2024 14:27:34 -0400 Subject: [PATCH 1/3] ci: add base Windows E2E tests to PRs --- .github/workflows/pr.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a0daf3199f7c..c014cacd3158 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -121,6 +121,20 @@ jobs: - name: Run CLI E2E tests 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: + runs-on: windows-latest + steps: + - name: Initialize environment + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@a3d0749c4d64959e85843fbeb54507e830be0f44 + - name: Install node modules + run: yarn install --immutable + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@a3d0749c4d64959e85843fbeb54507e830be0f44 + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@a3d0749c4d64959e85843fbeb54507e830be0f44 + - 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" + e2e-package-managers: strategy: fail-fast: false From e95079c6795ce0d25b12d6156f24aed4c86d9f36 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:10:18 -0400 Subject: [PATCH 2/3] test: reduce flakiness of E2E rebuild test The rebuild E2E test now waits for the development server to indicate it has updated any clients before trying to fetch files. This improves the reliability of the test when using the application builder. --- tests/legacy-cli/e2e/tests/basic/rebuild.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/legacy-cli/e2e/tests/basic/rebuild.ts b/tests/legacy-cli/e2e/tests/basic/rebuild.ts index 787fe1acfb19..f512961366bc 100644 --- a/tests/legacy-cli/e2e/tests/basic/rebuild.ts +++ b/tests/legacy-cli/e2e/tests/basic/rebuild.ts @@ -6,7 +6,7 @@ import { ngServe } from '../../utils/project'; export default async function () { const esbuild = getGlobalVariable('argv')['esbuild']; - const validBundleRegEx = esbuild ? /complete\./ : /Compiled successfully\./; + const validBundleRegEx = esbuild ? /sent to client/ : /Compiled successfully\./; const lazyBundleRegEx = esbuild ? /chunk-/ : /src_app_lazy_lazy_component_ts\.js/; // Disable component stylesheet HMR to support page reload based rebuild testing. From dac6b6b43c1fb619fc41c322b51f87b135f4d5c9 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 1 Nov 2024 22:05:08 -0400 Subject: [PATCH 3/3] fix(@angular/build): check referenced files against native file paths When checking for bundler context invalidation for any referenced files, the native path format is now used to ensure that the watch files can be correctly matched. This is particularly important for Windows due to the differing path segment separator. --- .../build/src/tools/esbuild/angular/source-file-cache.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts b/packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts index 3b733cb412d5..2bc38bd12a89 100644 --- a/packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts +++ b/packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts @@ -36,6 +36,7 @@ export class SourceFileCache extends Map { for (let file of files) { file = path.normalize(file); invalid = this.loadResultCache.invalidate(file) || invalid; + invalid = extraWatchFiles.has(file) || invalid; // Normalize separators to allow matching TypeScript Host paths if (USING_WINDOWS) { @@ -44,8 +45,6 @@ export class SourceFileCache extends Map { invalid = this.delete(file) || invalid; this.modifiedFiles.add(file); - - invalid = extraWatchFiles.has(file) || invalid; } return invalid;