Skip to content

Commit

Permalink
Simplify Circle CI setup
Browse files Browse the repository at this point in the history
As detailed in puppeteer/puppeteer#894, v73 of Chrome breaks in certain
Docker setups. To see this error, manually edit the puppeteer config in
node_modules to pass 'dumpio: true'. You should then see

node_1 | [0320/100336.123457:FATAL:gpu_data_manager_impl_private.cc(892)] The display compositor is frequently crashing. Goodbye.

To avoid this, I simplify the setup by sticking to CircleCI images that bundle Chrome and Firefox to make
updating the tuple painless. Once an image version has been specified in docker-compose.yml, t should
not be more than a matter of 'npm run test-docker-config' to test a new version of the image.
  • Loading branch information
fatso83 committed Mar 20, 2019
1 parent 3951eb7 commit 4b7a947
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
18 changes: 4 additions & 14 deletions .circleci/config.yml
Expand Up @@ -20,24 +20,15 @@ jobs:
command: |
npm config set strict-ssl false
npm install
# install latest chrome unstable version
if node --version | grep -q '^v10'; then
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google.list
apt-get -qq update
apt-get -qq install -y --no-install-recommends google-chrome-stable
apt-get -qq install -y --no-install-recommends google-chrome-unstable
fi
- run:
name: Pre-Test
# ESLint only supports Node >=4
command: |
if node --version | grep -q '^v10'; then
npm run lint
npm run test-headless -- --chrome $(which google-chrome-stable) --allow-chrome-as-root
npm run test-webworker -- --chrome $(which google-chrome-stable) --allow-chrome-as-root
npm run test-headless -- --chrome "$SINON_CHROME_BIN" --allow-chrome-as-root
npm run test-webworker -- --chrome "$SINON_CHROME_BIN" --allow-chrome-as-root
npm run test-esm-bundle
if [ -z "$CIRCLE_PULL_REQUESTS" ]; then
Expand Down Expand Up @@ -65,10 +56,9 @@ jobs:
node-10:
<<: *common-build
docker:
- image: node:10
- image: circleci/node:10.15.1-browsers
environment:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
SINON_CHROME_BIN: /usr/bin/google-chrome-unstable
SINON_CHROME_BIN: /usr/bin/google-chrome-stable


workflows:
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Expand Up @@ -17,13 +17,13 @@ services:
volumes:
# This mounts the local directory - saving `npm install`
- ./:/home/node/app
command: >
sh -c "
$$SINON_CHROME_BIN --version

npm run test-headless -- --chrome $$SINON_CHROME_BIN --allow-chrome-as-root
# There are differences between Circle CI and Docker `command`,
# forcing us to do this little workaround
command: >
sh -c " $$SINON_CHROME_BIN --version
&& npm run test-headless -- --chrome $$SINON_CHROME_BIN --allow-chrome-as-root
&& npm run test-webworker -- --chrome $$SINON_CHROME_BIN --allow-chrome-as-root
&& npm run test-esm-bundle
&& npm run test-node
"
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -22,6 +22,7 @@
"test-webworker": "mochify --https-server 8080 test/webworker/webworker-support-assessment.js",
"test-esm": "mocha -r esm test/es2015/module-support-assessment-test.mjs",
"test-esm-bundle": "node test/es2015/check-esm-bundle-is-runnable.js",
"test-docker-image": "docker-compose up",
"test": "run-s test-node test-headless test-webworker test-esm",
"check-dependencies": "dependency-check package.json --unused --no-dev --ignore-module coveralls --ignore-module esm",
"build": "run-p build-esm build-bundle",
Expand Down

0 comments on commit 4b7a947

Please sign in to comment.