Skip to content

Commit

Permalink
removed node v4; added node v10
Browse files Browse the repository at this point in the history
* allowed overriding chrome path for esm tests
  • Loading branch information
fearphage authored and fatso83 committed May 29, 2018
1 parent 9d30dcf commit 5e49793
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 32 deletions.
61 changes: 31 additions & 30 deletions .circleci/config.yml
Expand Up @@ -3,12 +3,13 @@ jobs:
build-common: &common-build
docker:
- image: node
environment:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
working_directory: ~/sinon
steps:
- run:
name: Versions
command: |
npm version
command: npm version
- checkout
- restore_cache:
keys:
Expand All @@ -17,33 +18,31 @@ jobs:
- run:
name: Install dependencies
command: |
npm config set strict-ssl false
# puppeteer install script throws syntax errors for Node v4
# https://github.com/GoogleChrome/puppeteer/blob/f19e2ade0d4859435422131905e932abe3db199c/install.js#L66
if node --version | grep -q '^v4'; then
npm config set ignore-scripts true
npm install
npm config set ignore-scripts false
else
npm install
fi
npm config set strict-ssl false
npm install
# install latest chrome unstable version
if node --version | grep -q '^v6'; 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 update
apt-get install -y --no-install-recommends google-chrome-unstable
fi
# 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-unstable
fi
- run:
name: Pre-Test
# ESLint only supports Node >=4
command: |
if node --version | grep -q '^v6'; then
npm run lint;
npm run test-headless -- --chrome $(which google-chrome-unstable) --allow-chrome-as-root;
npm run test-webworker -- --chrome $(which google-chrome-unstable) --allow-chrome-as-root;
if node --version | grep -q '^v10'; then
npm run lint
npm run test-headless -- --chrome $(which google-chrome-unstable) --allow-chrome-as-root
npm run test-webworker -- --chrome $(which google-chrome-unstable) --allow-chrome-as-root
npm run test-esm-bundle
if [ -z "$CIRCLE_PULL_REQUESTS" ]; then
npm run test-cloud
fi
fi
- run:
name: Test
command: npm run test-node
Expand All @@ -52,27 +51,29 @@ jobs:
paths:
- node_modules

node-4:
<<: *common-build
docker:
- image: node:4-alpine

node-6:
<<: *common-build
docker:
- image: node:6
- image: node:6-alpine

node-8:
<<: *common-build
docker:
- image: node:8-alpine

node-10:
<<: *common-build
docker:
- image: node:10
environment:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
SINON_CHROME_BIN: /usr/bin/google-chrome-unstable


workflows:
version: 2
build:
jobs:
- node-4
- node-6
- node-8
- node-10
8 changes: 6 additions & 2 deletions test/es2015/check-esm-bundle-is-runnable.js
Expand Up @@ -26,8 +26,12 @@ process.chdir(`${__dirname}/../../pkg/`);
const sinonModule = fs.readFileSync("./sinon-esm.js");

async function evaluatePageContent() {
// https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-on-travis-ci
const browser = await puppeteer.launch({ args: ["--no-sandbox"] });
const browser = await puppeteer.launch({
// https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-on-travis-ci
args: ["--no-sandbox"],
// allow overriding chrome path
executablePath: process.env.SINON_CHROME_BIN || null
});
const page = await browser.newPage();

function die(reason) {
Expand Down

4 comments on commit 5e49793

@fatso83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we forgot to add Sauce Labs credentials for the test-headless bit. Do you know how/where to set them, @fearphage?

@fatso83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have them btw. Just pass me an email

@fearphage
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fatso83 DM'd on twitter. Couldn't find an email address. 😉

@fatso83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be visible in my Github profile (and on my commits). Checking Twitter now.

Please sign in to comment.