Skip to content

Commit 166d3fb

Browse files
committed
ci: enforce puppeteer launch preflight before tests (self-heal reinstall)
Recent runs still reached rush test with missing Chrome 148 despite install steps. Add a hard pre-test gate that: - lists installed puppeteer browsers, - validates launch via puppeteer.launch(headless:'new'), - if launch fails, clears chrome/chrome-headless-shell cache entries, reinstalls both browsers explicitly, and re-validates launch. This prevents test execution when browser install silently no-ops or leaves an unusable cache state.
1 parent 48b11b8 commit 166d3fb

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ jobs:
5151
exit 1
5252
- run: node common/scripts/install-run-rush.js check
5353
- run: node common/scripts/install-run-rush.js update --full --recheck
54+
- name: Verify puppeteer chrome is launchable (reinstall on miss)
55+
run: |
56+
npx puppeteer browsers list || true
57+
node -e "const p=require('puppeteer'); p.launch({headless:'new', args:['--no-sandbox']}).then(async b=>{await b.close(); console.log('Puppeteer launch OK');}).catch(()=>process.exit(1));" || {
58+
echo "Puppeteer launch failed; reinstalling browsers..."
59+
rm -rf ~/.cache/puppeteer/chrome ~/.cache/puppeteer/chrome-headless-shell
60+
npx puppeteer browsers install chrome
61+
npx puppeteer browsers install chrome-headless-shell
62+
npx puppeteer browsers list
63+
node -e "const p=require('puppeteer'); p.launch({headless:'new', args:['--no-sandbox']}).then(async b=>{await b.close(); console.log('Puppeteer launch OK after reinstall');}).catch((e)=>{console.error(e); process.exit(1);});"
64+
}
5465
- run: npm run build --verbose
5566
timeout-minutes: 20
5667
- run: npm run test --verbose

0 commit comments

Comments
 (0)