fix(e2e): run electron-backend-e2e targets without nested pnpm exec

Under `pnpm nx`, the outer pnpm switches to the pinned version and exports
npm_config_manage_package_manager_versions=false. A nested `pnpm exec` then
runs as the older global pnpm, which executes from the workspace root instead
of the target cwd, so cwd-relative specs, globs and configs are not found
("Could not find '<paths joined by commas>'").

Call tsx and playwright directly (run-commands already puts node_modules/.bin
on PATH), quote the harness glob so Node expands it, guard against pnpm exec
returning, and run the performance harness in CI's unit/typecheck job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Opus 5.5 committed 2026-09-29 20:50:26 +02:00
1 parent 963a431bb7
commit 015911aa1f
5 files changed
+40 -13

No files matched your search

+9
View File
@@ -435,6 +435,15 @@ jobs:
- name: Check i18n drift
run: pnpm run i18n:check
# Node specs for the benchmark and journey harness (about ten
# seconds). They live in the E2E app, which the unit coverage scope
# below treats as out of scope, so this step is not gated by it.
- name: Test the performance harness
run: pnpm nx run electron-backend-e2e:test-performance-harness --skip-nx-cache
env:
CI: true
NX_TASKS_RUNNER_DYNAMIC_OUTPUT: false
# A pull request whose changes cannot reach any Tier A test (docs,
# notes, other workflows, website, E2E and mock-server apps, release
# and packaging tooling, a scripts-only package.json edit) skips the
+8 -8
View File
@@ -16,7 +16,7 @@
"executor": "nx:run-commands",
"options": {
"cwd": "apps/electron-backend-e2e",
"command": "pnpm exec tsx --test src/performance/*.spec.ts"
"command": "tsx --test \"src/performance/*.spec.ts\""
}
},
"benchmark-m3u-refresh-cancellation": {
@@ -26,7 +26,7 @@
"parallelism": false,
"options": {
"cwd": "apps/electron-backend-e2e",
"command": "pnpm exec playwright test --config=playwright.performance.config.ts src/m3u-refresh-cancellation.performance.ts"
"command": "playwright test --config=playwright.performance.config.ts src/m3u-refresh-cancellation.performance.ts"
}
},
"benchmark-m3u-import": {
@@ -36,7 +36,7 @@
"parallelism": false,
"options": {
"cwd": "apps/electron-backend-e2e",
"command": "pnpm exec playwright test --config=playwright.performance.config.ts src/m3u-import.performance.ts"
"command": "playwright test --config=playwright.performance.config.ts src/m3u-import.performance.ts"
}
},
"benchmark-xtream": {
@@ -46,7 +46,7 @@
"parallelism": false,
"options": {
"cwd": "apps/electron-backend-e2e",
"command": "pnpm exec playwright test --config=playwright.xtream-performance.config.ts src/xtream.performance.ts"
"command": "playwright test --config=playwright.xtream-performance.config.ts src/xtream.performance.ts"
}
},
"benchmark-charset-parse": {
@@ -55,7 +55,7 @@
"parallelism": false,
"options": {
"cwd": "apps/electron-backend-e2e",
"command": "pnpm exec tsx --expose-gc --tsconfig tsconfig.json src/performance/charset-parse.benchmark.ts"
"command": "tsx --expose-gc --tsconfig tsconfig.json src/performance/charset-parse.benchmark.ts"
}
},
"journeys": {
@@ -65,7 +65,7 @@
"parallelism": false,
"options": {
"cwd": "apps/electron-backend-e2e",
"command": "pnpm exec playwright test --config=playwright.journeys.config.ts"
"command": "playwright test --config=playwright.journeys.config.ts"
}
},
"packaged-frame-copy-smoke": {
@@ -78,14 +78,14 @@
],
"options": {
"cwd": "apps/electron-backend-e2e",
"command": "pnpm exec playwright test --config=playwright.packaged.config.ts src/embedded-mpv-frame-copy-packaged.e2e.ts"
"command": "playwright test --config=playwright.packaged.config.ts src/embedded-mpv-frame-copy-packaged.e2e.ts"
}
},
"test-packaged-frame-copy-fixtures": {
"executor": "nx:run-commands",
"options": {
"cwd": "apps/electron-backend-e2e",
"command": "pnpm exec tsx --test src/embedded-mpv-frame-copy-packaged-fixtures.spec.ts"
"command": "tsx --test src/embedded-mpv-frame-copy-packaged-fixtures.spec.ts"
}
},
"lint": {
@@ -88,10 +88,23 @@ test('the performance harness target runs only Node performance specs', () => {
assert.equal(target.options?.['cwd'], 'apps/electron-backend-e2e');
assert.equal(
target.options?.['command'],
'pnpm exec tsx --test src/performance/*.spec.ts'
'tsx --test "src/performance/*.spec.ts"'
);
});
// A nested `pnpm exec` under `pnpm nx` can run from the workspace root instead
// of the target cwd (an older global pnpm with version switching disabled), so
// cwd-relative globs, specs and configs are not found. run-commands already
// puts node_modules/.bin on PATH.
test('electron-backend-e2e command targets call binaries without pnpm exec', () => {
for (const [name, target] of Object.entries(e2eProject.targets)) {
const command = target.options?.['command'];
if (typeof command !== 'string') continue;
assert.doesNotMatch(command, /\bpnpm exec\b/, name);
}
});
test('the web performance build keeps production renderer behavior with profiling source maps', () => {
const build = webProject.targets['build'];
const production = build.configurations?.['production'];
@@ -242,7 +255,7 @@ test('the cancellation benchmark command is pinned to its Playwright test file',
assert.equal(
target.options?.['command'],
'pnpm exec playwright test --config=playwright.performance.config.ts src/m3u-refresh-cancellation.performance.ts'
'playwright test --config=playwright.performance.config.ts src/m3u-refresh-cancellation.performance.ts'
);
});
@@ -283,7 +296,7 @@ test('the initial M3U import benchmark command is pinned to its Playwright test
assert.equal(
target.options?.['command'],
'pnpm exec playwright test --config=playwright.performance.config.ts src/m3u-import.performance.ts'
'playwright test --config=playwright.performance.config.ts src/m3u-import.performance.ts'
);
});
@@ -346,7 +346,7 @@ describe('Xtream Playwright and Nx plumbing', () => {
assert.equal(target?.['parallelism'], false);
assert.equal(
(target?.['options'] as Record<string, unknown>)?.['command'],
'pnpm exec playwright test --config=playwright.xtream-performance.config.ts src/xtream.performance.ts'
'playwright test --config=playwright.xtream-performance.config.ts src/xtream.performance.ts'
);
assert.equal(
(entrypoint.match(/runXtreamBenchmark\(\)/g) ?? []).length,
+6 -1
View File
@@ -264,7 +264,12 @@ target `master` and for `master` pushes (dispatch it with
journey spec against the Xtream mock: J1 launch, then J2 open-source (a
second set of launches, each followed by the click on the portal card), both
written to the same summary file; its probe specs run with
`pnpm nx run electron-backend-e2e:test-performance-harness`. The contract, what
`pnpm nx run electron-backend-e2e:test-performance-harness`, which CI runs in
the `Unit Tests and Typechecks` job of `ci.yml` on every run. The
`electron-backend-e2e` command targets call `tsx` and `playwright` directly,
not through `pnpm exec`: under `pnpm nx`, a nested `pnpm exec` can run from the
workspace root instead of the target `cwd` and miss cwd-relative specs, globs
and configs. The contract, what
counts and how to add a counter or a journey are in the
[performance journeys](performance-journeys.md) document.