From 5cea23a9f36f5e3e60a5222bd880601807165500 Mon Sep 17 00:00:00 2001 From: Phred Date: Mon, 18 Dec 2017 19:29:23 -0600 Subject: [PATCH 01/13] enabled headless and webwork tests * reverts parts of #1629 --- .circleci/config.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1154d4230..07727a4b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,17 +18,20 @@ jobs: name: Install dependencies command: | npm config set strict-ssl false - # Avoid downloading chromium unnecessarily - npm config set ignore-scripts true + if ! node --version | grep -q '^v6'; then + # Avoid downloading chromium unnecessarily + npm config set ignore-scripts true + fi npm install npm config set ignore-scripts false - run: name: Pre-Test # ESLint only supports Node >=4 command: | - NODE_VERSION=$(node --version) - if [[ ${NODE_VERSION:0:3} == "v6." ]]; then + if node --version | grep -q '^v6'; then npm run lint; + npm run test-headless; + npm run test-webworker; fi - run: name: Test From 0feae336af1c6bd40baa5e0da9d529463f863084 Mon Sep 17 00:00:00 2001 From: Phred Date: Mon, 18 Dec 2017 20:04:22 -0600 Subject: [PATCH 02/13] installing latest version of chrome --- .circleci/config.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07727a4b8..cff88a75d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,12 +18,14 @@ jobs: name: Install dependencies command: | npm config set strict-ssl false - if ! node --version | grep -q '^v6'; then - # Avoid downloading chromium unnecessarily - npm config set ignore-scripts true - fi npm install - npm config set ignore-scripts false + + 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 - run: name: Pre-Test # ESLint only supports Node >=4 @@ -45,6 +47,8 @@ jobs: <<: *common-build docker: - image: node:4 + environment: + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true node-6: <<: *common-build @@ -55,6 +59,8 @@ jobs: <<: *common-build docker: - image: node:8 + environment: + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true workflows: version: 2 From 65b8cb0eafae921cdb2a69f9ebc818bf4fba596c Mon Sep 17 00:00:00 2001 From: Phred Date: Mon, 18 Dec 2017 20:44:12 -0600 Subject: [PATCH 03/13] override chrome path --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cff88a75d..d54f0afbf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ jobs: command: | if node --version | grep -q '^v6'; then npm run lint; - npm run test-headless; + npm run test-headless -- --chrome $(which google-chrome-unstable); npm run test-webworker; fi - run: From d4a0e2c0a8cc864dcef0e3229a4350f866ecd9f2 Mon Sep 17 00:00:00 2001 From: Phred Date: Mon, 18 Dec 2017 20:48:35 -0600 Subject: [PATCH 04/13] use debian instead of alpine --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d54f0afbf..af3e4b9ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ jobs: node-6: <<: *common-build docker: - - image: node:6-alpine + - image: node:6 node-8: <<: *common-build From 07763c430fef3361885894194ed0e89790c12bf0 Mon Sep 17 00:00:00 2001 From: Phred Date: Tue, 19 Dec 2017 08:47:27 -0600 Subject: [PATCH 05/13] hack mochify to pass additional params to chrome --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index af3e4b9ab..d290168a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,6 +32,8 @@ jobs: command: | if node --version | grep -q '^v6'; then npm run lint; + # modify mochify to pass additional params to chrome + sed -i "s#'--allow-insecure-localhost'#'--allow-insecure-localhost', '--no-sandbox', '--disable-setuid-sandbox'#" node_modules/mochify/lib/chromium.js && echo "modified mochify/lib/chromium.js"; npm run test-headless -- --chrome $(which google-chrome-unstable); npm run test-webworker; fi From 9ef9a20134d62586acf7fb2670b82684b77d4cab Mon Sep 17 00:00:00 2001 From: Phred Date: Tue, 19 Dec 2017 08:50:03 -0600 Subject: [PATCH 06/13] pass updated chrome path to test-webworker --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d290168a6..cd7f2e82c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,7 @@ jobs: # modify mochify to pass additional params to chrome sed -i "s#'--allow-insecure-localhost'#'--allow-insecure-localhost', '--no-sandbox', '--disable-setuid-sandbox'#" node_modules/mochify/lib/chromium.js && echo "modified mochify/lib/chromium.js"; npm run test-headless -- --chrome $(which google-chrome-unstable); - npm run test-webworker; + npm run test-webworker -- --chrome $(which google-chrome-unstable); fi - run: name: Test From 4fd01efb1f6ddcfc462392dbc8c81e19c5067f3d Mon Sep 17 00:00:00 2001 From: Phred Date: Tue, 19 Dec 2017 09:01:38 -0600 Subject: [PATCH 07/13] ignore-scripts for node v4 --- .circleci/config.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd7f2e82c..7f0cecd1a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,15 @@ jobs: name: Install dependencies command: | npm config set strict-ssl false - npm install + # 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 if node --version | grep -q '^v6'; then wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - From 360c2e7df1d4d61bc97b1dc769d7d4bf5ee4b99a Mon Sep 17 00:00:00 2001 From: Phred Date: Tue, 19 Dec 2017 09:13:52 -0600 Subject: [PATCH 08/13] added more details and notes --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f0cecd1a..38d337c42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,6 +28,7 @@ jobs: npm install fi + # 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 @@ -40,7 +41,9 @@ jobs: command: | if node --version | grep -q '^v6'; then npm run lint; - # modify mochify to pass additional params to chrome + # HACK: modify mochify to pass args to chrome to allow it to run as root + # --no-sandbox --disable-setuid-sandbox + # See https://github.com/mantoni/mochify.js/issues/162 sed -i "s#'--allow-insecure-localhost'#'--allow-insecure-localhost', '--no-sandbox', '--disable-setuid-sandbox'#" node_modules/mochify/lib/chromium.js && echo "modified mochify/lib/chromium.js"; npm run test-headless -- --chrome $(which google-chrome-unstable); npm run test-webworker -- --chrome $(which google-chrome-unstable); @@ -57,8 +60,6 @@ jobs: <<: *common-build docker: - image: node:4 - environment: - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true node-6: <<: *common-build From ecdc4e02b395af12e1bf79e015e63590140e3fec Mon Sep 17 00:00:00 2001 From: Phred Date: Tue, 19 Dec 2017 11:08:13 -0600 Subject: [PATCH 09/13] test with updated mochify --- .circleci/config.yml | 8 ++------ package.json | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 38d337c42..3cff8bc0e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,12 +41,8 @@ jobs: command: | if node --version | grep -q '^v6'; then npm run lint; - # HACK: modify mochify to pass args to chrome to allow it to run as root - # --no-sandbox --disable-setuid-sandbox - # See https://github.com/mantoni/mochify.js/issues/162 - sed -i "s#'--allow-insecure-localhost'#'--allow-insecure-localhost', '--no-sandbox', '--disable-setuid-sandbox'#" node_modules/mochify/lib/chromium.js && echo "modified mochify/lib/chromium.js"; - npm run test-headless -- --chrome $(which google-chrome-unstable); - npm run test-webworker -- --chrome $(which google-chrome-unstable); + 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; fi - run: name: Test diff --git a/package.json b/package.json index e2999fe9f..5e964e6da 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "lint-staged": "^4.0.0", "markdownlint-cli": "^0.4.0", "mocha": "^4.0.0", - "mochify": "^5.0.0", + "mochify": "mantoni/mochify.js#2cdbc02a4db887bfe3604f8d18f593c980f7897e", "mochify-istanbul": "^2.4.1", "native-promise-only": "^0.8.1", "npm-run-all": "^4.0.2", From 177c4b6d28750f23fb1e1cc9de18f555f309ca54 Mon Sep 17 00:00:00 2001 From: Phred Date: Tue, 19 Dec 2017 11:15:38 -0600 Subject: [PATCH 10/13] upgraded to the lastest official version of mochify --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e964e6da..55d338a5c 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "lint-staged": "^4.0.0", "markdownlint-cli": "^0.4.0", "mocha": "^4.0.0", - "mochify": "mantoni/mochify.js#2cdbc02a4db887bfe3604f8d18f593c980f7897e", + "mochify": "^5.1.0", "mochify-istanbul": "^2.4.1", "native-promise-only": "^0.8.1", "npm-run-all": "^4.0.2", From d078af96b0e881374eb090b03d6903819ccf9169 Mon Sep 17 00:00:00 2001 From: Phred Date: Tue, 19 Dec 2017 11:18:52 -0600 Subject: [PATCH 11/13] try using default chrome install --- .circleci/config.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3cff8bc0e..d15a51b39 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,22 +27,14 @@ jobs: else npm install fi - - # 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 - 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; + npm run test-headless -- --allow-chrome-as-root; + npm run test-webworker -- --allow-chrome-as-root; fi - run: name: Test From 63156211c53ff09c017f6ecc4c5ee1b7a22751d6 Mon Sep 17 00:00:00 2001 From: Phred Date: Tue, 19 Dec 2017 11:39:45 -0600 Subject: [PATCH 12/13] invalidate cache --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d15a51b39..312d10274 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,8 +12,8 @@ jobs: - checkout - restore_cache: keys: - - v1-npm-{{ .Branch }}-{{ checksum "package.json" }} - - v1-npm-master-{{ checksum "package.json" }} + - v2-npm-{{ .Branch }}-{{ checksum "package.json" }} + - v2-npm-master-{{ checksum "package.json" }} - run: name: Install dependencies command: | @@ -40,7 +40,7 @@ jobs: name: Test command: npm run test-node - save_cache: - key: v1-npm-{{ .Branch }}-{{ checksum "package.json" }} + key: v2-npm-{{ .Branch }}-{{ checksum "package.json" }} paths: - node_modules From 39186f4276c5b47d9e616c4d1e65d3d2948f70ec Mon Sep 17 00:00:00 2001 From: Phred Date: Tue, 19 Dec 2017 11:45:38 -0600 Subject: [PATCH 13/13] use google-chrome-unstable for tests switched v4 and v8 to using alpine images --- .circleci/config.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 312d10274..d8999a521 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,8 +12,8 @@ jobs: - checkout - restore_cache: keys: - - v2-npm-{{ .Branch }}-{{ checksum "package.json" }} - - v2-npm-master-{{ checksum "package.json" }} + - v3-npm-{{ .Branch }}-{{ checksum "package.json" }} + - v3-npm-master-{{ checksum "package.json" }} - run: name: Install dependencies command: | @@ -27,27 +27,35 @@ jobs: else npm install fi + + # 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 - run: name: Pre-Test # ESLint only supports Node >=4 command: | if node --version | grep -q '^v6'; then npm run lint; - npm run test-headless -- --allow-chrome-as-root; - npm run test-webworker -- --allow-chrome-as-root; + 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; fi - run: name: Test command: npm run test-node - save_cache: - key: v2-npm-{{ .Branch }}-{{ checksum "package.json" }} + key: v3-npm-{{ .Branch }}-{{ checksum "package.json" }} paths: - node_modules node-4: <<: *common-build docker: - - image: node:4 + - image: node:4-alpine node-6: <<: *common-build @@ -57,7 +65,7 @@ jobs: node-8: <<: *common-build docker: - - image: node:8 + - image: node:8-alpine environment: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true