mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-14 05:30:55 +00:00
Pre-check integration node_modules before root-playwright wrapper assertion
This commit is contained in:
parent
216b3cae38
commit
8e49e68393
1 changed files with 18 additions and 10 deletions
|
|
@ -834,20 +834,28 @@ test_root_playwright_wrapper_prefers_managed_browser_runtime() {
|
||||||
}
|
}
|
||||||
EOF
|
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
|
# of tests/integration/, not the workspace root) and chain-imports
|
||||||
# runtime-defaults.ts. Both create environment-sensitivity: the package
|
# runtime-defaults.ts. Without those node_modules, npx tsx --eval blows
|
||||||
# may not be installed (fresh clones, CI smoke jobs that haven't run
|
# up before bash sees an exit code we can guard on. The CI smoke job
|
||||||
# the integration-tests setup) and tsx's `--eval` mode doesn't always
|
# and fresh clones both hit this; the test only meaningfully checks
|
||||||
# propagate the TS loader to transitive .ts requires under some Node
|
# local-dev behavior anyway.
|
||||||
# versions. Treat any of those as a skip rather than letting an env
|
if [[ ! -d "${ROOT_DIR}/tests/integration/node_modules/@playwright/test" ]]; then
|
||||||
# quirk fail the suite.
|
echo "[SKIP] root-playwright wrapper check (tests/integration/node_modules/@playwright/test not installed)"
|
||||||
if ! output="$(
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
set +e
|
||||||
|
output="$(
|
||||||
cd "${ROOT_DIR}" && \
|
cd "${ROOT_DIR}" && \
|
||||||
PULSE_E2E_RUNTIME_STATE_PATH="${runtime_state}" \
|
PULSE_E2E_RUNTIME_STATE_PATH="${runtime_state}" \
|
||||||
npx --yes tsx --eval "import config from './playwright.config.ts'; console.log(config.use?.baseURL || '');" 2>&1
|
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
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue