Fix Bloblang CI failing on missing Puppeteer Chrome#399
Conversation
The workflow caches node_modules but not ~/.cache/puppeteer, where Puppeteer downloads its Chrome binary during npm ci's postinstall step. On a node_modules cache hit, npm ci is skipped, so Chrome is never installed and the test runner fails with "Could not find Chrome". Add an explicit, always-run step to install Chrome for Puppeteer, plus a dedicated cache for ~/.cache/puppeteer so it stays fast.
✅ Deploy Preview for docs-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe Bloblang playground test workflow now caches Puppeteer browser downloads from Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The explicit chrome install lands the binary in ~/.cache/puppeteer, but
on a node_modules cache hit npm ci (and Puppeteer's postinstall) is
skipped, and Puppeteer's launch-time cache-dir resolution still fails to
find it ("Could not find Chrome").
Capture the exact binary path the installer prints and export it as
PUPPETEER_EXECUTABLE_PATH, which puppeteer.launch() honors directly,
bypassing cache-dir resolution for both test steps.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Problem
The Bloblang Tests workflow keeps failing on the Build and Test Playground step — but it is not a test failure. The Puppeteer-based test runner cannot find a browser to launch:
```
❌ Test execution failed: Could not find Chrome (ver. 121.0.6167.85).
... your cache path is ... /home/runner/.cache/puppeteer
```
Root cause
Puppeteer downloads its Chrome binary into
~/.cache/puppeteeras a postinstall step ofnpm ci— not intonode_modules. The workflow had a caching gap:node_modules, not~/.cache/puppeteer.npm ciwas gated on a cache miss (if: steps.cache-node-modules.outputs.cache-hit != 'true').Once the
node_modulescache was warm,npm ciwas permanently skipped → Puppeteer's postinstall never ran → Chrome was never present → every subsequent run failed on browser launch. This is why it kept failing rather than being flaky.Fix
npx puppeteer browsers install chrome) that runs unconditionally, guaranteeing the browser exists before the tests launch it — independent of thenode_modulescache.~/.cache/puppeteerso the install stays a fast no-op on cache hits.