Skip to content

Commit

Permalink
Merge pull request #1999 from fatso83/fix-docker-headless-tests
Browse files Browse the repository at this point in the history
Fix Circle CI headless builds breaking
  • Loading branch information
fatso83 committed Mar 20, 2019
2 parents 2119f08 + 4b7a947 commit c85fa66
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 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
29 changes: 29 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,29 @@
# Docker Compose setup file
# Purpose: testbed for changes to Circle CI setup
# Usage: `docker-compose up`
version: "3"
services:
node:
image: "circleci/node:10.15.1-browsers"
user: "root"
working_dir: /home/node/app

# use the one built-in to the image to avoid potential issues like
# https://github.com/GoogleChrome/puppeteer/issues/3774
# This variable is used by all scripts - including the `test-esm-bundle`
environment:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
SINON_CHROME_BIN: /usr/bin/google-chrome-stable
volumes:
# This mounts the local directory - saving `npm install`
- ./:/home/node/app

# 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 c85fa66

Please sign in to comment.