From 1d9024ee9a98039daee177c881c37bf0b5a79222 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Mon, 11 Dec 2017 16:27:29 +0200 Subject: [PATCH] build: pin ChromeDriver version (#20940) Since our version of Chromium is also pinned, a new ChromeDriver (that drops support for our Chromium version) can cause random (and unrelated to the corresponding changes) errors on CI. This commit pins the version of ChromeDriver and it should now be manually upgraded to a vrsion that is compatible with th currently used Chromium version. PR Close #20940 --- aio/package.json | 2 +- aio/tools/examples/shared/package.json | 2 +- integration/hello_world__closure/package.json | 2 +- integration/hello_world__systemjs_umd/package.json | 2 +- package.json | 3 ++- packages/platform-server/integrationtest/package.json | 3 ++- scripts/ci/env.sh | 3 ++- scripts/ci/install.sh | 8 +------- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/aio/package.json b/aio/package.json index 0431e3d634..c575a860d5 100644 --- a/aio/package.json +++ b/aio/package.json @@ -57,7 +57,7 @@ "~~check-env": "node scripts/check-environment", "~~build": "ng build --target=production --environment=stable -sm --build-optimizer", "post~~build": "yarn sw-manifest && yarn sw-copy", - "~~update-webdriver": "webdriver-manager update --standalone false --gecko false" + "~~update-webdriver": "webdriver-manager update --standalone false --gecko false $CHROMEDRIVER_VERSION_ARG" }, "engines": { "node": ">=6.9.5 <7.0.0", diff --git a/aio/tools/examples/shared/package.json b/aio/tools/examples/shared/package.json index 85ba989112..9c665fc06d 100644 --- a/aio/tools/examples/shared/package.json +++ b/aio/tools/examples/shared/package.json @@ -6,7 +6,7 @@ "scripts": { "http-server": "http-server", "protractor": "protractor", - "webdriver:update": "webdriver-manager update --standalone false --gecko false", + "webdriver:update": "webdriver-manager update --standalone false --gecko false $CHROMEDRIVER_VERSION_ARG", "postinstall": "yarn webdriver:update" }, "keywords": [], diff --git a/integration/hello_world__closure/package.json b/integration/hello_world__closure/package.json index 51ec7029ba..78519201cc 100644 --- a/integration/hello_world__closure/package.json +++ b/integration/hello_world__closure/package.json @@ -23,7 +23,7 @@ "protractor": "file:../../node_modules/protractor" }, "scripts": { - "postinstall": "webdriver-manager update --gecko false", + "postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG", "closure": "java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf", "test": "ngc && yarn run closure && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first", "serve": "lite-server -c e2e/browser.config.json", diff --git a/integration/hello_world__systemjs_umd/package.json b/integration/hello_world__systemjs_umd/package.json index c3b3fb42b2..bc65edc9bc 100644 --- a/integration/hello_world__systemjs_umd/package.json +++ b/integration/hello_world__systemjs_umd/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "license": "MIT", "scripts": { - "postinstall": "webdriver-manager update --gecko false", + "postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG", "test": "concurrently \"npm run serve\" \"npm run protractor\" --kill-others --success first", "serve": "lite-server -c bs-config.e2e.json", "preprotractor": "tsc -p e2e", diff --git a/package.json b/package.json index e99953aacb..df5f92f5d2 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ }, "scripts": { "preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/')\"", - "postinstall": "webdriver-manager update --gecko false", + "postinstall": "yarn update-webdriver", + "update-webdriver": "webdriver-manager update --gecko false $CHROMEDRIVER_VERSION_ARG", "check-env": "gulp check-env" }, "dependencies": { diff --git a/packages/platform-server/integrationtest/package.json b/packages/platform-server/integrationtest/package.json index 8f57802a95..9ce9f58dce 100644 --- a/packages/platform-server/integrationtest/package.json +++ b/packages/platform-server/integrationtest/package.json @@ -34,10 +34,11 @@ "webpack": "^2.2.1" }, "scripts": { + "postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG", "build": "./build.sh", "test": "npm run build && concurrently \"npm run serve\" \"npm run protractor\" --kill-others --success first", "serve": "node built/server-bundle.js", - "preprotractor": "webdriver-manager update --gecko false && tsc -p e2e", + "preprotractor": "tsc -p e2e", "protractor": "protractor e2e/protractor.config.js" } } diff --git a/scripts/ci/env.sh b/scripts/ci/env.sh index adcfc73633..b820e90d88 100755 --- a/scripts/ci/env.sh +++ b/scripts/ci/env.sh @@ -17,7 +17,7 @@ function setEnvVar() { if [[ ${print} == "print" ]]; then echo ${name}=${value} fi - export ${name}=${value} + export ${name}="${value}" } # use BASH_SOURCE so that we get the right path when this script is called AND source-d @@ -37,6 +37,7 @@ fi setEnvVar NODE_VERSION 6.9.5 setEnvVar YARN_VERSION 1.0.2 setEnvVar CHROMIUM_VERSION 499098 # Chrome 62 linux stable, see https://www.chromium.org/developers/calendar +setEnvVar CHROMEDRIVER_VERSION_ARG "--versions.chrome 2.33" setEnvVar SAUCE_CONNECT_VERSION 4.4.9 setEnvVar PROJECT_ROOT $(cd ${thisDir}/../..; pwd) diff --git a/scripts/ci/install.sh b/scripts/ci/install.sh index 74ba83fe50..20479787c9 100755 --- a/scripts/ci/install.sh +++ b/scripts/ci/install.sh @@ -35,7 +35,7 @@ travisFoldEnd "install-yarn" # Install all npm dependencies according to yarn.lock travisFoldStart "yarn-install" - node tools/npm/check-node-modules --purge || yarn install --freeze-lockfile --non-interactive + (node tools/npm/check-node-modules --purge && yarn update-webdriver) || yarn install --frozen-lockfile --non-interactive travisFoldEnd "yarn-install" @@ -102,12 +102,6 @@ if [[ ${TRAVIS} && (${CI_MODE} == "browserstack_required" || ${CI_MODE} == "brow fi -# Install Selenium WebDriver -travisFoldStart "webdriver-manager-update" - $(npm bin)/webdriver-manager update -travisFoldEnd "webdriver-manager-update" - - # Install bower packages travisFoldStart "bower-install" $(npm bin)/bower install