Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Pre-check integration node_modules before root-playwright wrapper assertion

rcourtman8e49e68393ae
diff --git a/scripts/tests/test-hot-dev-bg.sh b/scripts/tests/test-hot-dev-bg.sh
index d25de39044..794da0e049 100755
--- a/scripts/tests/test-hot-dev-bg.sh
+++ b/scripts/tests/test-hot-dev-bg.sh
@@ -834,20 +834,28 @@ test_root_playwright_wrapper_prefers_managed_browser_runtime() {
}
EOF
- # The root playwright.config.ts imports @playwright/test (devDependency
+ # Skip in environments without the tests/integration npm install, since
+ # the root playwright.config.ts imports @playwright/test (devDependency
# of tests/integration/, not the workspace root) and chain-imports
- # runtime-defaults.ts. Both create environment-sensitivity: the package
- # may not be installed (fresh clones, CI smoke jobs that haven't run
- # the integration-tests setup) and tsx's `--eval` mode doesn't always
- # propagate the TS loader to transitive .ts requires under some Node
- # versions. Treat any of those as a skip rather than letting an env
- # quirk fail the suite.
- if ! output="$(
+ # runtime-defaults.ts. Without those node_modules, npx tsx --eval blows
+ # up before bash sees an exit code we can guard on. The CI smoke job
+ # and fresh clones both hit this; the test only meaningfully checks
+ # local-dev behavior anyway.
+ if [[ ! -d "${ROOT_DIR}/tests/integration/node_modules/@playwright/test" ]]; then
+ echo "[SKIP] root-playwright wrapper check (tests/integration/node_modules/@playwright/test not installed)"
+ return 0
+ fi
+
+ set +e
+ output="$(
cd "${ROOT_DIR}" && \
PULSE_E2E_RUNTIME_STATE_PATH="${runtime_state}" \
npx --yes tsx --eval "import config from './playwright.config.ts'; console.log(config.use?.baseURL || '');" 2>&1
- )"; then
- echo "[SKIP] root-playwright wrapper check (tsx/playwright eval not available: ${output:0:80}...)"
+ )"
+ local rc=$?
+ set -e
+ if (( rc != 0 )); then
+ echo "[SKIP] root-playwright wrapper check (tsx eval failed rc=${rc}: ${output:0:80})"
return 0
fi