pre-build docker image which contains puppeteer's chromium
Closes #159 (closed)
I really tried out a lot of things, here are the results:
build(jest): Tell jest to detect open handles
Apparently when the browser doesn't start we can get catched in a state
where jest doesn't error. By providing this option --detectOpenHandles
we can safely detect such probblems and error earlier.
chore(puppeteer): Forward puppeteer to 1.11.0
In order to be able to tell puppeteer where the Chromium executable is, we need to update it
ci: Prebuild a docker image with puppeteer
This adds a pre-build stage to our CI which builds a puppeteer docker image if necessary. The process works like this:
- Check if the puppeteer version in .gitlab-ci.yml and yarn.lock match, if not -> bail
- Check if we already have an image for that puppeteer version, if yes, we do not need to build and can exit
- Get the chrome revision from the supplied puppeteer version
- Build a image based on gitlab-build-images:gitlab-puppeteer and install the supplied puppeteer version globally
- Set PUPPETEER_EXECUTABLE_PATH to the path of the chromium revision installed globally by puppeteer
- Check if the executable exists
- Set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD to true, so that subsequent local installs do not try to download the chromium executable
- Push the image to the gitlab-ui registry
ci: Consolidate build stage
The build stage does not produce any artifact needed for the test stage. So we can literally just move the build job to the test stage in order to parallelize efforts.
The update_snapshots job is moved to the pre-build stage as it is a manual job anyway.
All jobs that do not depend on the results of the build job now have this dependency removed.