Skip to content

Commit af84b41

Browse files
committed
ci: run separate npm package manager E2E tests
Improves the organization of the E2E tests by grouping package manager related tests into the same job matrix. Also reduces the number of test shards for the core E2E tests by one due to the lower amount of tests.
1 parent 9f28807 commit af84b41

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
os: [ubuntu-latest]
8282
node: [20, 22, 24]
8383
subset: [esbuild, webpack]
84-
shard: [0, 1, 2, 3, 4, 5]
84+
shard: [0, 1, 2, 3, 4]
8585
runs-on: ${{ matrix.os }}
8686
steps:
8787
- name: Initialize environment
@@ -95,7 +95,7 @@ jobs:
9595
with:
9696
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
9797
- name: Run CLI E2E tests
98-
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 }}
98+
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=5 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
9999

100100
build-e2e-windows:
101101
runs-on: ubuntu-latest
@@ -135,7 +135,7 @@ jobs:
135135
os: [windows-2025]
136136
node: [22]
137137
subset: [esbuild, webpack]
138-
shard: [0, 1, 2, 3, 4, 5]
138+
shard: [0, 1, 2, 3, 4]
139139
runs-on: ${{ matrix.os }}
140140
steps:
141141
- name: Initialize environment
@@ -152,7 +152,14 @@ jobs:
152152
with:
153153
test_target_name: e2e.${{ matrix.subset }}_node${{ matrix.node }}
154154
env:
155-
E2E_SHARD_TOTAL: 6
155+
E2E_SHARD_TOTAL: 5
156+
E2E_SHARD_INDEX: ${{ matrix.shard }}
157+
- name: Run CLI npm package manager tests
158+
uses: ./.github/shared-actions/windows-bazel-test
159+
with:
160+
test_target_name: e2e.npm_node${{ matrix.node }}
161+
env:
162+
E2E_SHARD_TOTAL: 5
156163
E2E_SHARD_INDEX: ${{ matrix.shard }}
157164

158165
e2e-package-managers:
@@ -162,7 +169,7 @@ jobs:
162169
matrix:
163170
os: [ubuntu-latest]
164171
node: [22]
165-
subset: [yarn, pnpm, bun]
172+
subset: [npm, yarn, pnpm, bun]
166173
shard: [0, 1, 2]
167174
runs-on: ${{ matrix.os }}
168175
steps:
@@ -188,7 +195,7 @@ jobs:
188195
os: [ubuntu-latest]
189196
node: [22]
190197
subset: [esbuild, webpack]
191-
shard: [0, 1, 2, 3, 4, 5]
198+
shard: [0, 1, 2, 3, 4]
192199
runs-on: ${{ matrix.os }}
193200
steps:
194201
- name: Initialize environment
@@ -202,7 +209,7 @@ jobs:
202209
with:
203210
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
204211
- name: Run CLI E2E tests
205-
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 }}
212+
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=5 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
206213

207214
browsers:
208215
needs: build

.github/workflows/pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
os: [ubuntu-latest]
112112
node: [22]
113113
subset: [esbuild, webpack]
114-
shard: [0, 1, 2, 3, 4, 5]
114+
shard: [0, 1, 2, 3, 4]
115115
runs-on: ${{ matrix.os }}
116116
steps:
117117
- name: Initialize environment
@@ -123,7 +123,7 @@ jobs:
123123
- name: Setup Bazel RBE
124124
uses: angular/dev-infra/github-actions/bazel/configure-remote@73051ae248ba64911a8e7e66536d8c99ba07ef2a
125125
- name: Run CLI E2E tests
126-
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 }}
126+
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=5 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
127127

128128
build-e2e-windows-subset:
129129
runs-on: ubuntu-latest
@@ -180,7 +180,7 @@ jobs:
180180
matrix:
181181
os: [ubuntu-latest]
182182
node: [22]
183-
subset: [yarn, pnpm, bun]
183+
subset: [npm, yarn, pnpm, bun]
184184
shard: [0, 1, 2]
185185
runs-on: ${{ matrix.os }}
186186
steps:
@@ -204,7 +204,7 @@ jobs:
204204
os: [ubuntu-latest]
205205
node: [22]
206206
subset: [esbuild, webpack]
207-
shard: [0, 1, 2, 3, 4, 5]
207+
shard: [0, 1, 2, 3, 4]
208208
runs-on: ${{ matrix.os }}
209209
steps:
210210
- name: Initialize environment
@@ -216,4 +216,4 @@ jobs:
216216
- name: Setup Bazel RBE
217217
uses: angular/dev-infra/github-actions/bazel/configure-remote@73051ae248ba64911a8e7e66536d8c99ba07ef2a
218218
- name: Run CLI E2E tests
219-
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 }}
219+
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=5 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}

tests/legacy-cli/e2e.bzl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def e2e_suites(name, runner, data):
8888
_e2e_suite(name, runner, "esbuild", data, toolchain_name, toolchain)
8989

9090
# Package manager subsets
91+
_e2e_suite(name, runner, "npm", data, toolchain_name, toolchain)
9192
_e2e_suite(name, runner, "bun", data, toolchain_name, toolchain)
9293
_e2e_suite(name, runner, "pnpm", data, toolchain_name, toolchain)
9394
_e2e_suite(name, runner, "yarn", data, toolchain_name, toolchain)
@@ -143,7 +144,7 @@ def _e2e_tests(name, runner, toolchain, **kwargs):
143144

144145
def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None):
145146
"""
146-
Setup a predefined test suite (yarn|pnpm|bun|esbuild|saucelabs|npm).
147+
Setup a predefined test suite (yarn|pnpm|bun|esbuild|webpack|saucelabs|npm).
147148
"""
148149
args = []
149150
tests = None
@@ -152,22 +153,22 @@ def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None):
152153
if toolchain_name:
153154
toolchain_name = "_" + toolchain_name
154155

155-
if type == "yarn" or type == "bun" or type == "pnpm":
156+
if type == "npm" or type == "yarn" or type == "bun" or type == "pnpm":
156157
args.append("--package-manager=%s" % type)
157158
args.append("--esbuild")
158159
tests = PACKAGE_MANAGER_SUBSET_TESTS
159-
ignore = BROWSER_TESTS + WEBPACK_IGNORE_TESTS
160+
ignore = BROWSER_TESTS
160161
elif type == "esbuild":
161162
args.append("--esbuild")
162163
tests = ESBUILD_TESTS
163-
ignore = BROWSER_TESTS
164+
ignore = BROWSER_TESTS + PACKAGE_MANAGER_SUBSET_TESTS
164165
elif type == "saucelabs":
165166
args.append("--esbuild")
166167
tests = BROWSER_TESTS
167168
ignore = None
168169
elif type == "webpack":
169170
tests = None
170-
ignore = BROWSER_TESTS + WEBPACK_IGNORE_TESTS
171+
ignore = BROWSER_TESTS + WEBPACK_IGNORE_TESTS + PACKAGE_MANAGER_SUBSET_TESTS
171172

172173
# Standard e2e tests
173174
_e2e_tests(

0 commit comments

Comments
 (0)