Skip to content

pre-build docker image which contains puppeteer's chromium

Lukas 'ai-pi' Eipert requested to merge leipert-cache-node_modules into master

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:

  1. Check if the puppeteer version in .gitlab-ci.yml and yarn.lock match, if not -> bail
  2. Check if we already have an image for that puppeteer version, if yes, we do not need to build and can exit
  3. Get the chrome revision from the supplied puppeteer version
  4. Build a image based on gitlab-build-images:gitlab-puppeteer and install the supplied puppeteer version globally
  5. Set PUPPETEER_EXECUTABLE_PATH to the path of the chromium revision installed globally by puppeteer
  6. Check if the executable exists
  7. Set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD to true, so that subsequent local installs do not try to download the chromium executable
  8. 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.

Edited by Lukas 'ai-pi' Eipert

Merge request reports