Pārlūkot izejas kodu

Install chromedriver /cc @hedgerh @arturi

Kevin van Zonneveld 9 gadi atpakaļ
vecāks
revīzija
8721af2152
4 mainītis faili ar 47 papildinājumiem un 1 dzēšanām
  1. 5 0
      .travis.yml
  2. 1 0
      CHANGELOG.md
  3. 40 0
      bin/post-install
  4. 1 1
      package.json

+ 5 - 0
.travis.yml

@@ -9,6 +9,8 @@ addons:
       - ubuntu-toolchain-r-test
     packages:
       - g++-4.8
+      - libnss3-dev
+      - libgconf-2-4
 
 cache:
   apt: true
@@ -16,6 +18,9 @@ cache:
     - node_modules
     - website/node_modules
 
+before_script:
+  - export PATH=${PATH}:${HOME}/bin/
+
 script:
   - npm run build
   - npm run test

+ 1 - 0
CHANGELOG.md

@@ -49,6 +49,7 @@ Ideas that will be planned and find their way into a release at one point
 
 ## 0.0.4 (April 04, 2016)
 
+- [x] test: Install chromedriver (@kvz)
 - [x] core: re-think running architecture: allow for `acquiring` while `uploading` (@arturi)
 - [x] allow for continuous `acquiring`, even after all plugins have “run” (@arturi, @hedgerh)
 - [x] core: start on component & event-based state management with `yo-yo` (@arturi)

+ 40 - 0
bin/post-install

@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+set -o pipefail
+set -o errexit
+set -o nounset
+# set -o xtrace
+
+# Set magic variables for current file & dir
+__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
+__base="$(basename ${__file} .sh)"
+
+colorRed='\033[0;31m'
+colorGreen='\033[0;32m'
+colorReset='\033[0m'
+
+export PATH="${PATH}:${HOME}/bin/"
+
+echo -n "--> Checking for chromedriver: "
+if which chromedriver 2>&1 > /dev/null; then
+  echo -e "${colorGreen}✓${colorReset}"
+else
+  echo -e "${colorRed}✗${colorReset}"
+  echo "--> Installing chromedriver"
+  if [[ "${OSTYPE}" == "darwin"* ]]; then
+    brew install chromedriver
+  else
+    mkdir -p "${HOME}/bin/"
+    wget 'http://chromedriver.storage.googleapis.com/2.21/chromedriver_linux64.zip'
+    unzip -o chromedriver_linux64.zip && rm -f chromedriver_linux64.zip
+    chmod 755 chromedriver
+  fi
+  echo -n "--> Verifying chromedriver: "
+  if chromedriver -v 2>&1 > /dev/null; then
+    echo -e "${colorGreen}✓${colorReset}"
+  else
+    echo -e "${colorRed}✗${colorReset}"
+    chromedriver -v
+    exit 1
+  fi
+fi

+ 1 - 1
package.json

@@ -20,6 +20,7 @@
     "build:bundle:fullpath": "env OUT=uppy-fp.js ./bin/build-bundle --full-paths",
     "build:bundle:min": "./bin/build-bundle",
     "build:bundle": "./bin/build-bundle && ./bin/build-bundle-locales",
+    "install": "bin/post-install",
     "release": "npm version ${SEMANTIC:-patch} -m \"Release %s\" && git push && git push --tags && npm publish",
     "release:major": "env SEMANTIC=major npm run release",
     "release:minor": "env SEMANTIC=minor npm run release",
@@ -66,7 +67,6 @@
     "node-sass": "3.4.2",
     "nodemon": "1.8.1",
     "parallelshell": "2.0.0",
-    "phantomjs": "1.9.18",
     "selenium-webdriver": "^2.52.0",
     "tape": "4.4.0",
     "uppy-server": "0.0.1",