fix(e2e): let web-e2e:e2e run outside CI

Without CI, every web-e2e webServer has reuseExistingServer, so
@nx/playwright infers a continuous web:serve dependency for the
`pnpm nx run web:serve` entry. The mocks and the web backend launch as
plain node processes with env, which no Nx task covers, so the plugin
also marks the target non-parallel. Nx refuses a non-parallel task with
continuous dependencies, and `nx run web-e2e:e2e` failed before running
anything; CI passed only because CI=1 disables reuse and with it the
inferred dependency.

Give web-e2e:e2e an empty dependsOn so Playwright starts every server,
as it already does in CI. The Angular dev-server runs inside the Nx
process, so Playwright's process-group kill still stops it. Turn off
the plugin's readiness gate, which no target consumes any more.

Add `pnpm run e2e:task-graphs:validate`: it builds every Playwright
target's task graph with Nx's own validation, with CI unset and set,
and runs in the unit-and-typecheck job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Opus 5.5 committed 2026-10-01 06:29:38 +02:00
1 parent 525ca7bc44
commit 3f3e9ffefb
9 files changed
+260 -16

No files matched your search

+22
View File
@@ -582,6 +582,28 @@ without being listed there. The `serve` targets remain the entry point
for starting a mock by hand. The web-e2e `web-backend` entry uses the same
launch form; see [PWA web backend](pwa-self-hosted.md#web-backend).
Playwright, not Nx, starts every E2E server, including the web dev server.
`@nx/playwright/plugin` infers a continuous `serve` dependency from a
`pnpm nx run <project>:serve` webServer only while `reuseExistingServer` is
true, which the configs set only when `CI` is unset. It also sets
`parallelism: false` on a target when a webServer has an `env` or a plain
`node` command, because no Nx task covers that server. Nx refuses to run a
non-parallel task that depends on a continuous task, so the inferred
`web-e2e:e2e` failed locally with "do not support parallelism but depend on
continuous tasks" and passed only in CI. Therefore:
- `apps/web-e2e/project.json` sets `e2e.dependsOn` to `[]`, and the filtered
`e2e-ci--src/*.e2e.ts` target default in `nx.json` does the same for the
per-file web targets. The per-file Electron targets depend only on
`electron-backend:build-e2e`. Do not add the mocks' Nx `serve` targets as
dependencies: Playwright already starts the mocks.
- The plugin runs with `waitForWebServer: false`, because no target consumes
its `e2e--wait-for-webserver` readiness task. Playwright's own URL probe
covers readiness.
- `pnpm run e2e:task-graphs:validate` (`tools/nx/check-e2e-task-graphs.mjs`)
builds each Playwright target's task graph with Nx's own validation, once
with `CI` unset and once with it set.
### Request Interception
The Angular PWA calls `localhost:3000/xtream?...`. Playwright intercepts these: