Skip to content

Commit 7d3e0ad

Browse files
committed
test: migrate legacy CLI tests to e2e directory
Remove an extra level.
1 parent f39f7ee commit 7d3e0ad

File tree

369 files changed

+1033
-805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+1033
-805
lines changed

.github/shared-actions/windows-bazel-test/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ runs:
2424
- name: Convert symlinks for Windows host
2525
shell: pwsh
2626
run: |
27-
$runfiles_dir = "./dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles"
27+
$runfiles_dir = "./dist/bin/tests/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles"
2828
2929
# Needed for resolution because Aspect/Bazel looks for repositories at `<workspace>/external`.
3030
# TODO(devversion): consult with Aspect on why this is needed.
@@ -38,5 +38,5 @@ runs:
3838
E2E_TEMP: ${{ inputs.e2e_temp_dir }}
3939
run: |
4040
node ./scripts/windows-testing/parallel-executor.mjs \
41-
"./dist/bin/tests/legacy-cli/${{ inputs.test_target_name }}_/${{ inputs.test_target_name }}.bat.runfiles" \
41+
"./dist/bin/tests/${{ inputs.test_target_name }}_/${{ inputs.test_target_name }}.bat.runfiles" \
4242
${{ inputs.test_target_name }}

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- name: Install node modules
7272
run: pnpm install --frozen-lockfile
7373
- name: Run module and package tests
74-
run: pnpm bazel test -- //... -//tests/legacy-cli/...
74+
run: pnpm bazel test -- //... -//tests/...
7575

7676
e2e:
7777
needs: test
@@ -94,7 +94,7 @@ jobs:
9494
with:
9595
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
9696
- name: Run CLI E2E tests
97-
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 }}
97+
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 }}
9898

9999
build-e2e-windows:
100100
runs-on: ubuntu-latest
@@ -113,15 +113,15 @@ jobs:
113113
run: |
114114
pnpm bazel build \
115115
--config=e2e \
116-
//tests/legacy-cli:e2e.webpack_node22 \
117-
//tests/legacy-cli:e2e.esbuild_node22 \
116+
//tests:e2e.webpack_node22 \
117+
//tests:e2e.esbuild_node22 \
118118
--platforms=tools:windows_x64
119119
- name: Store built Windows E2E tests
120120
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
121121
with:
122122
name: win-e2e-build-artifacts
123123
path: |
124-
dist/bin/tests/legacy-cli/**
124+
dist/bin/tests/**
125125
!**/node_modules/**
126126
retention-days: 1
127127
if-no-files-found: 'error'
@@ -144,7 +144,7 @@ jobs:
144144
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
145145
with:
146146
name: win-e2e-build-artifacts
147-
path: dist/bin/tests/legacy-cli/
147+
path: dist/bin/tests/
148148
- name: Run CLI E2E tests
149149
uses: ./.github/shared-actions/windows-bazel-test
150150
with:
@@ -174,7 +174,7 @@ jobs:
174174
with:
175175
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
176176
- name: Run CLI E2E tests
177-
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 }}
177+
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 }}
178178

179179
e2e-snapshots:
180180
needs: test
@@ -198,7 +198,7 @@ jobs:
198198
with:
199199
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
200200
- name: Run CLI E2E tests
201-
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 }}
201+
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 }}
202202

203203
browsers:
204204
needs: build
@@ -229,7 +229,7 @@ jobs:
229229
run: |
230230
./scripts/saucelabs/start-tunnel.sh &
231231
./scripts/saucelabs/wait-for-tunnel.sh
232-
pnpm bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs
232+
pnpm bazel test --config=saucelabs //tests:e2e.saucelabs
233233
./scripts/saucelabs/stop-tunnel.sh
234234
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
235235
if: ${{ failure() }}

.github/workflows/pr.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
with:
2929
filters: |
3030
snapshots:
31-
- 'tests/legacy-cli/e2e/ng-snapshot/package.json'
31+
- 'tests/e2e/ng-snapshot/package.json'
3232
3333
lint:
3434
runs-on: ubuntu-latest
@@ -101,7 +101,7 @@ jobs:
101101
- name: Install node modules
102102
run: pnpm install --frozen-lockfile
103103
- name: Run module and package tests
104-
run: pnpm bazel test -- //... -//tests/legacy-cli/...
104+
run: pnpm bazel test -- //... -//tests/...
105105

106106
e2e:
107107
needs: build
@@ -122,7 +122,7 @@ jobs:
122122
- name: Setup Bazel RBE
123123
uses: angular/dev-infra/github-actions/bazel/configure-remote@2562f2bd84bf2b992d4742d2f36895fd904d696a
124124
- name: Run CLI E2E tests
125-
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 }}
125+
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 }}
126126

127127
build-e2e-windows-subset:
128128
runs-on: ubuntu-latest
@@ -139,14 +139,14 @@ jobs:
139139
run: |
140140
pnpm bazel build \
141141
--config=e2e \
142-
//tests/legacy-cli:e2e.esbuild_node22 \
142+
//tests:e2e.esbuild_node22 \
143143
--platforms=tools:windows_x64
144144
- name: Store built Windows E2E tests
145145
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
146146
with:
147147
name: win-e2e-build-artifacts
148148
path: |
149-
dist/bin/tests/legacy-cli/**
149+
dist/bin/tests/**
150150
!**/node_modules/**
151151
retention-days: 1
152152
if-no-files-found: 'error'
@@ -163,7 +163,7 @@ jobs:
163163
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
164164
with:
165165
name: win-e2e-build-artifacts
166-
path: dist/bin/tests/legacy-cli/
166+
path: dist/bin/tests/
167167
- name: Run CLI E2E tests
168168
uses: ./.github/shared-actions/windows-bazel-test
169169
with:
@@ -191,7 +191,7 @@ jobs:
191191
- name: Setup Bazel RBE
192192
uses: angular/dev-infra/github-actions/bazel/configure-remote@2562f2bd84bf2b992d4742d2f36895fd904d696a
193193
- name: Run CLI E2E tests
194-
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 }}
194+
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 }}
195195

196196
e2e-snapshots:
197197
needs: [analyze, build]
@@ -213,4 +213,4 @@ jobs:
213213
- name: Setup Bazel RBE
214214
uses: angular/dev-infra/github-actions/bazel/configure-remote@2562f2bd84bf2b992d4742d2f36895fd904d696a
215215
- name: Run CLI E2E tests
216-
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 }}
216+
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 }}

.prettierignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
/packages/schematics/angular/third_party/
1212
/README.md
1313
/CONTRIBUTING.md
14-
.yarn/
1514
dist/
16-
/tests/legacy-cli/e2e/assets/
15+
/tests/e2e/assets/
1716
/tools/test/*.json
1817
pnpm-lock.yaml

docs/DEVELOPER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ You can find more info about debugging [tests with Bazel in the docs.](https://g
8989
### End to end tests
9090

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

9696
When running the debug commands, Node will stop and wait for a debugger to attach.

renovate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"baseBranchPatterns": ["main", "21.0.x"],
44
"extends": ["github>angular/dev-infra//renovate-presets/default.json5"],
55
"ignoreDeps": ["less"],
6-
"ignorePaths": ["tests/legacy-cli/e2e/assets/**", "tests/schematics/update/packages/**"],
6+
"ignorePaths": ["tests/e2e/assets/**", "tests/schematics/update/packages/**"],
77
"packageRules": [
88
{
99
"enabled": false,
10-
"matchFileNames": ["tests/legacy-cli/e2e/ng-snapshot/package.json"],
10+
"matchFileNames": ["tests/e2e/ng-snapshot/package.json"],
1111
"matchBaseBranches": ["!main"]
1212
},
1313
{

tests/BUILD.bazel

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,78 @@
1+
load("@aspect_bazel_lib//lib:directory_path.bzl", "directory_path")
12
load("@npm//:defs.bzl", "npm_link_all_packages")
3+
load("@npm//:rollup/package_json.bzl", rollup = "bin")
4+
load("//tools:defaults.bzl", "ts_project")
5+
load(":e2e.bzl", "e2e_suites")
26

3-
# Copyright Google Inc. All Rights Reserved.
4-
#
5-
# Use of this source code is governed by an MIT-style license that can be
6-
# found in the LICENSE file at https://angular.dev/license
77
package(default_visibility = ["//visibility:public"])
88

99
licenses(["notice"])
1010

1111
npm_link_all_packages()
12+
13+
ts_project(
14+
name = "runner",
15+
testonly = True,
16+
srcs = [
17+
"e2e_runner.ts",
18+
],
19+
deps = [
20+
"//:node_modules/@types/node",
21+
"//:node_modules/fast-glob",
22+
"//packages/angular_devkit/core",
23+
"//packages/angular_devkit/core/node",
24+
"//tests/e2e/utils",
25+
],
26+
)
27+
28+
rollup.rollup(
29+
name = "runner_bundled",
30+
testonly = True,
31+
srcs = [
32+
"rollup.config.mjs",
33+
":runner",
34+
"//:node_modules/@rollup/plugin-alias",
35+
"//:node_modules/@rollup/plugin-commonjs",
36+
"//:node_modules/@rollup/plugin-json",
37+
"//:node_modules/@rollup/plugin-node-resolve",
38+
"//:node_modules/fast-glob",
39+
"//tests/e2e/initialize",
40+
"//tests/e2e/ng-snapshot",
41+
"//tests/e2e/setup",
42+
"//tests/e2e/tests",
43+
],
44+
args = [
45+
"--format=cjs",
46+
"--config=./rollup.config.mjs",
47+
],
48+
chdir = package_name(),
49+
out_dirs = ["runner_bundled_out"],
50+
progress_message = "Bundling e2e test runner",
51+
)
52+
53+
directory_path(
54+
name = "runner_entrypoint",
55+
testonly = True,
56+
directory = ":runner_bundled",
57+
path = "./e2e_runner.js",
58+
)
59+
60+
e2e_suites(
61+
name = "e2e",
62+
data = [
63+
":runner_bundled",
64+
"verdaccio.yaml",
65+
"verdaccio_auth.yaml",
66+
67+
# Dynamically loaded.
68+
"//tests/e2e/assets",
69+
"//:node_modules/verdaccio",
70+
"//:node_modules/verdaccio-auth-memory",
71+
72+
# Extra runtime deps due to bundling issues.
73+
# TODO: Clean this up.
74+
"//:node_modules/express",
75+
"//:node_modules/undici",
76+
],
77+
runner = ":runner_entrypoint",
78+
)

tests/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)