Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/shared-actions/windows-bazel-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
- name: Convert symlinks for Windows host
shell: pwsh
run: |
$runfiles_dir = "./dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles"
$runfiles_dir = "./dist/bin/tests/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles"

# Needed for resolution because Aspect/Bazel looks for repositories at `<workspace>/external`.
# TODO(devversion): consult with Aspect on why this is needed.
Expand All @@ -38,5 +38,5 @@ runs:
E2E_TEMP: ${{ inputs.e2e_temp_dir }}
run: |
node ./scripts/windows-testing/parallel-executor.mjs \
"./dist/bin/tests/legacy-cli/${{ inputs.test_target_name }}_/${{ inputs.test_target_name }}.bat.runfiles" \
"./dist/bin/tests/${{ inputs.test_target_name }}_/${{ inputs.test_target_name }}.bat.runfiles" \
${{ inputs.test_target_name }}
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Run module and package tests
run: pnpm bazel test -- //... -//tests/legacy-cli/...
run: pnpm bazel test -- //... -//tests/...

e2e:
needs: test
Expand All @@ -94,7 +94,7 @@ jobs:
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Run CLI E2E tests
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }}

build-e2e-windows:
runs-on: ubuntu-latest
Expand All @@ -113,15 +113,15 @@ jobs:
run: |
pnpm bazel build \
--config=e2e \
//tests/legacy-cli:e2e.webpack_node22 \
//tests/legacy-cli:e2e.esbuild_node22 \
//tests:e2e.webpack_node22 \
//tests:e2e.esbuild_node22 \
--platforms=tools:windows_x64
- name: Store built Windows E2E tests
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: win-e2e-build-artifacts
path: |
dist/bin/tests/legacy-cli/**
dist/bin/tests/**
!**/node_modules/**
retention-days: 1
if-no-files-found: 'error'
Expand All @@ -144,7 +144,7 @@ jobs:
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: win-e2e-build-artifacts
path: dist/bin/tests/legacy-cli/
path: dist/bin/tests/
- name: Run CLI E2E tests
uses: ./.github/shared-actions/windows-bazel-test
with:
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Run CLI E2E tests
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }}

e2e-snapshots:
needs: test
Expand All @@ -198,7 +198,7 @@ jobs:
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Run CLI E2E tests
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}

browsers:
needs: build
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
run: |
./scripts/saucelabs/start-tunnel.sh &
./scripts/saucelabs/wait-for-tunnel.sh
pnpm bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs
pnpm bazel test --config=saucelabs //tests:e2e.saucelabs
./scripts/saucelabs/stop-tunnel.sh
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: ${{ failure() }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
filters: |
snapshots:
- 'tests/legacy-cli/e2e/ng-snapshot/package.json'
- 'tests/e2e/ng-snapshot/package.json'

lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Run module and package tests
run: pnpm bazel test -- //... -//tests/legacy-cli/...
run: pnpm bazel test -- //... -//tests/...

e2e:
needs: build
Expand All @@ -122,7 +122,7 @@ jobs:
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@2562f2bd84bf2b992d4742d2f36895fd904d696a
- name: Run CLI E2E tests
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }}

build-e2e-windows-subset:
runs-on: ubuntu-latest
Expand All @@ -139,14 +139,14 @@ jobs:
run: |
pnpm bazel build \
--config=e2e \
//tests/legacy-cli:e2e.esbuild_node22 \
//tests:e2e.esbuild_node22 \
--platforms=tools:windows_x64
- name: Store built Windows E2E tests
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: win-e2e-build-artifacts
path: |
dist/bin/tests/legacy-cli/**
dist/bin/tests/**
!**/node_modules/**
retention-days: 1
if-no-files-found: 'error'
Expand All @@ -163,7 +163,7 @@ jobs:
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: win-e2e-build-artifacts
path: dist/bin/tests/legacy-cli/
path: dist/bin/tests/
- name: Run CLI E2E tests
uses: ./.github/shared-actions/windows-bazel-test
with:
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@2562f2bd84bf2b992d4742d2f36895fd904d696a
- name: Run CLI E2E tests
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }}

e2e-snapshots:
needs: [analyze, build]
Expand All @@ -213,4 +213,4 @@ jobs:
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@2562f2bd84bf2b992d4742d2f36895fd904d696a
- name: Run CLI E2E tests
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
/packages/schematics/angular/third_party/
/README.md
/CONTRIBUTING.md
.yarn/
dist/
/tests/legacy-cli/e2e/assets/
/tests/e2e/assets/
/tools/test/*.json
pnpm-lock.yaml
4 changes: 2 additions & 2 deletions docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ You can find more info about debugging [tests with Bazel in the docs.](https://g
### End to end tests

- For a complete list of test targets use the following Bazel query: `pnpm bazel query "tests(//tests/...)"`
- Run a subset of the tests: `pnpm bazel test //tests/legacy-cli:e2e_node22 --config=e2e --test_filter="tests/i18n/ivy-localize-*"`
- Use `bazel run` to debug failing tests debugging: `pnpm bazel run //tests/legacy-cli:e2e_node22 --config=e2e --test_arg="--glob=tests/basic/aot.ts"`
- Run a subset of the tests: `pnpm bazel test //tests:e2e_node22 --config=e2e --test_filter="tests/i18n/ivy-localize-*"`
- Use `bazel run` to debug failing tests debugging: `pnpm bazel run //tests:e2e_node22 --config=e2e --test_arg="--glob=tests/basic/aot.ts"`
- Provide additional `e2e_runner` options using `--test_arg`: `--test_arg="--package-manager=yarn"`

When running the debug commands, Node will stop and wait for a debugger to attach.
Expand Down
4 changes: 2 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"baseBranchPatterns": ["main", "21.0.x"],
"extends": ["github>angular/dev-infra//renovate-presets/default.json5"],
"ignoreDeps": ["less"],
"ignorePaths": ["tests/legacy-cli/e2e/assets/**", "tests/schematics/update/packages/**"],
"ignorePaths": ["tests/e2e/assets/**", "tests/schematics/update/packages/**"],
"packageRules": [
{
"enabled": false,
"matchFileNames": ["tests/legacy-cli/e2e/ng-snapshot/package.json"],
"matchFileNames": ["tests/e2e/ng-snapshot/package.json"],
"matchBaseBranches": ["!main"]
},
{
Expand Down
75 changes: 71 additions & 4 deletions tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,78 @@
load("@aspect_bazel_lib//lib:directory_path.bzl", "directory_path")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm//:rollup/package_json.bzl", rollup = "bin")
load("//tools:defaults.bzl", "ts_project")
load(":e2e.bzl", "e2e_suites")

# Copyright Google Inc. All Rights Reserved.
#
# 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
package(default_visibility = ["//visibility:public"])

licenses(["notice"])

npm_link_all_packages()

ts_project(
name = "runner",
testonly = True,
srcs = [
"e2e_runner.ts",
],
deps = [
"//:node_modules/@types/node",
"//:node_modules/fast-glob",
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
"//tests/e2e/utils",
],
)

rollup.rollup(
name = "runner_bundled",
testonly = True,
srcs = [
"rollup.config.mjs",
":runner",
"//:node_modules/@rollup/plugin-alias",
"//:node_modules/@rollup/plugin-commonjs",
"//:node_modules/@rollup/plugin-json",
"//:node_modules/@rollup/plugin-node-resolve",
"//:node_modules/fast-glob",
"//tests/e2e/initialize",
"//tests/e2e/ng-snapshot",
"//tests/e2e/setup",
"//tests/e2e/tests",
],
args = [
"--format=cjs",
"--config=./rollup.config.mjs",
],
chdir = package_name(),
out_dirs = ["runner_bundled_out"],
progress_message = "Bundling e2e test runner",
)

directory_path(
name = "runner_entrypoint",
testonly = True,
directory = ":runner_bundled",
path = "./e2e_runner.js",
)

e2e_suites(
name = "e2e",
data = [
":runner_bundled",
"verdaccio.yaml",
"verdaccio_auth.yaml",

# Dynamically loaded.
"//tests/e2e/assets",
"//:node_modules/verdaccio",
"//:node_modules/verdaccio-auth-memory",

# Extra runtime deps due to bundling issues.
# TODO: Clean this up.
"//:node_modules/express",
"//:node_modules/undici",
],
runner = ":runner_entrypoint",
)
11 changes: 0 additions & 11 deletions tests/README.md

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@
"outputPath": "dist/nineteen-project",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
],
"styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -73,20 +69,15 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
],
"styles": ["src/styles.css"],
"scripts": []
}
}
Expand Down
Loading
Loading