Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containerize Puppeteer #1836

Closed
wants to merge 2 commits into from
Closed

Containerize Puppeteer #1836

wants to merge 2 commits into from

Conversation

raineorshine
Copy link
Contributor

@raineorshine raineorshine commented Apr 26, 2024

Update 2024-05-04: Puppeteer finally passes in GitHub Actions with the macos-latest test runner. This issue is now about running the Puppeteer tests in a Docker container. This would normalize browser rendering across platforms, albeit at the cost of additional test ops complexity.

Puppeteer currently works locally but fails in GitHub Actions.

@raineorshine raineorshine changed the title Fix puppeteer with node v20 Puppeteer + GitHubActions Apr 26, 2024
@raineorshine raineorshine force-pushed the node-v20-puppeteer branch 6 times, most recently from 81d0fd4 to a7672ec Compare April 27, 2024 12:21
@raineorshine
Copy link
Contributor Author

raineorshine commented Apr 27, 2024

  • Disabling some Chrome features got the Puppeteer tests running again (a7672ec)
  • Snapshots are failing due to inconsistent screenshot sizes.
    • jest-image-snapshot now appears to screenshot the whole document, not just the viewport
    • Local screenshots are 800x756 while GitHub Actions screenshots are 800x600 (?)
    • May have been caused by an old version of chromium. Fixed by reinstalling puppeteer.
  • Snapshots pass locally but not on GitHub Actions
    • 24/40 snapshots failed
    • 10–800 pixels not matching
    • Sizes match

@raineorshine raineorshine force-pushed the node-v20-puppeteer branch 4 times, most recently from 69eb46e to 62a8ca7 Compare April 27, 2024 21:31
@raineorshine
Copy link
Contributor Author

raineorshine commented Apr 27, 2024

Attempting to containerize Puppeteer to generate uniform snapshots across platforms. Not yet integrated into GitHub Actions, but added two Docker-related scripts that can be run manually:

  • docker:build
  • docker:run

Resources:

Error running yarn test:puppeteer in container:

Error: Failed to launch the browser process!
/app/node_modules/puppeteer/.local-chromium/linux-869685/chrome-linux/chrome: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory

@raineorshine
Copy link
Contributor Author

raineorshine commented Apr 28, 2024

The main GitHub issue for people having trouble getting chrome to launch: puppeteer/puppeteer#807

Now just getting the error:

net::ERR_CONNECTION_REFUSED at http://localhost:3000

@raineorshine raineorshine mentioned this pull request Apr 28, 2024
@raineorshine raineorshine changed the title Puppeteer + GitHubActions Containerize Puppeteer May 4, 2024
@raineorshine
Copy link
Contributor Author

Closing since #1845 fixed Puppeteer on GitHubActions, which was the original reason to containerize. This can be reopened if the macos-latest Puppeteer runner proves to be unstable.

@raineorshine raineorshine reopened this May 26, 2024
@raineorshine raineorshine mentioned this pull request May 26, 2024
3 tasks
@raineorshine raineorshine deleted the node-v20-puppeteer branch September 19, 2024 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant