mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-09 01:16:15 -08:00
ci(e2e): skip Playwright browser installs in the Electron shards (#1708)
* ci(e2e): skip Playwright browser installs in the Electron shards The Electron suite drives Electron through Playwright's _electron API and never launches a Playwright browser or records video, so the per-shard `playwright install --with-deps` only downloaded unused browsers (about 3.5 minutes per Windows shard, nine shards per run). Linux shards now run a quick check that xvfb-run and Electron's shared libraries are present on the runner image instead. The web E2E job keeps its Chromium install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(e2e): fail the Linux Electron dependency check when ldd cannot run A missing Electron binary or a failing ldd left the "not found" grep empty, so the preflight passed and the launch failed later without a diagnostic. Check the binary first and report missing libraries before an ldd failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(e2e): resolve the Electron binary before checking its libraries Electron 42+ downloads its binary on the first require('electron'), which used to happen inside Playwright's _electron.launch(). The Linux preflight ran before that and looked for node_modules/electron/dist/electron, which does not exist yet on a fresh runner. Resolve the binary through require('electron') so the download happens first and the check inspects the same path Playwright launches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: 4gray <fourgray@proton.me> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 file changed
+24
-2
@@ -87,8 +87,30 @@ jobs:
|
||||
if: matrix.shard == 1
|
||||
run: pnpm exec tsx --test apps/electron-backend-e2e/src/performance/electron-process-lifecycle.spec.ts apps/electron-backend-e2e/src/performance/electron-process-termination.spec.ts
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: pnpm exec playwright install --with-deps
|
||||
# The suite drives Electron through Playwright's _electron API and
|
||||
# never launches a Playwright browser (or records video, which
|
||||
# would need Playwright's ffmpeg), so no `playwright install`.
|
||||
# The Ubuntu runner image already ships Electron's shared
|
||||
# libraries and xvfb; fail fast with a clear message if an image
|
||||
# update ever drops one. Electron 42+ downloads its binary on the
|
||||
# first `require('electron')` (previously inside
|
||||
# `_electron.launch()`), so resolve it the same way first.
|
||||
- name: Check Electron runtime dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
command -v xvfb-run || { echo "::error::xvfb-run is missing on the runner"; exit 1; }
|
||||
node -e "require('electron')" || { echo "::error::Electron binary download failed"; exit 1; }
|
||||
electron_bin="$(node -p "require('electron')")"
|
||||
[ -x "$electron_bin" ] || { echo "::error::Electron binary not found at $electron_bin"; exit 1; }
|
||||
ldd_status=0
|
||||
libs="$(ldd "$electron_bin")" || ldd_status=$?
|
||||
missing="$(grep 'not found' <<< "$libs" || true)"
|
||||
if [ -n "$missing" ]; then
|
||||
echo "::error::Electron is missing shared libraries:"
|
||||
echo "$missing"
|
||||
exit 1
|
||||
fi
|
||||
[ "$ldd_status" -eq 0 ] || { echo "::error::ldd failed on $electron_bin (exit $ldd_status)"; exit 1; }
|
||||
|
||||
- name: Run Electron E2E Tests (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
|
||||
Reference in new issue
Block a user