fix(ci): retain and retry the observed Playwright runtime corruption
This commit is contained in:
@@ -312,9 +312,16 @@ jobs:
|
||||
# checksum-valid npm download (`true` became `tr<garbage>e`, or a stray `break` appeared).
|
||||
# Retry only that unmistakable source-corruption signature from a new isolated cache.
|
||||
# Ordinary Axe violations and application assertions remain terminal.
|
||||
if grep -q "AxeBuilder.analyze" "$smoke_log" \
|
||||
&& grep -Eq "page\.evaluate: (ReferenceError|SyntaxError)" "$smoke_log"; then
|
||||
echo "Axe runtime source appears corrupted — reinstalling the locked dependencies from a fresh cache and retrying the complete suite once..."
|
||||
if { grep -q "AxeBuilder.analyze" "$smoke_log" \
|
||||
&& grep -Eq "page\.evaluate: (ReferenceError|SyntaxError)" "$smoke_log"; } \
|
||||
|| { grep -Eq 'node_modules/playwright-core/lib/utilsBundle\.js:[0-9]+' "$smoke_log" \
|
||||
&& grep -Fq 'const { items }$= this;' "$smoke_log" \
|
||||
&& grep -Fq 'SyntaxError: Missing initializer in destructuring declaration' "$smoke_log"; }; then
|
||||
echo "Browser runtime source appears corrupted — reinstalling the locked dependencies from a fresh cache and retrying the complete suite once..."
|
||||
mkdir -p .artifacts/browser-runtime-attempt-1
|
||||
cp "$smoke_log" .artifacts/browser-runtime-attempt-1/smoke.log
|
||||
if [ -d test-results ]; then cp -a test-results .artifacts/browser-runtime-attempt-1/; fi
|
||||
if [ -f .artifacts/playwright-results.json ]; then cp .artifacts/playwright-results.json .artifacts/browser-runtime-attempt-1/; fi
|
||||
rm -rf node_modules
|
||||
npm_cache="$(mktemp -d)"
|
||||
npm ci --no-audit --no-fund --cache "$npm_cache"
|
||||
@@ -336,6 +343,7 @@ jobs:
|
||||
name: browser-diagnostics
|
||||
path: |
|
||||
job-tracker-ui/.artifacts/playwright-results.json
|
||||
job-tracker-ui/.artifacts/browser-runtime-attempt-1/
|
||||
job-tracker-ui/test-results
|
||||
retention-days: 7
|
||||
|
||||
|
||||
Reference in New Issue
Block a user