Skip to content

Commit 69c05a1

Browse files
committed
test: migrate legacy CLI tests to e2e directory
Remove an extra level.
1 parent 92d2f2a commit 69c05a1

File tree

367 files changed

+1021
-792
lines changed

Some content is hidden

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

367 files changed

+1021
-792
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: 3 additions & 3 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
@@ -121,7 +121,7 @@ jobs:
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:

.github/workflows/pr.yml

Lines changed: 4 additions & 4 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
@@ -146,7 +146,7 @@ jobs:
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:

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
/CONTRIBUTING.md
1414
.yarn/
1515
dist/
16-
/tests/legacy-cli/e2e/assets/
16+
/tests/e2e/assets/
1717
/tools/test/*.json
1818
pnpm-lock.yaml

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.
File renamed without changes.

0 commit comments

Comments
 (0)