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
This commit is contained in:
George Kalpakas 2017-12-11 16:27:29 +02:00 committed by Jason Aden
parent 70cd124ede
commit 81d497ce1f
11 changed files with 16 additions and 12 deletions

View File

@ -56,7 +56,7 @@
"~~check-env": "node scripts/check-environment",
"~~build": "ng build --target=production --environment=stable -sm",
"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": ">=8.9.1 <9.0.0",

View File

@ -200,8 +200,10 @@ function runProtractorAoT(appDir, outputFile) {
// All protractor output is appended to the outputFile.
// CLI version
function runE2eTestsCLI(appDir, outputFile) {
// --preserve-symlinks is needed due the symlinked node_modules in each example
const e2eSpawn = spawnExt('yarn', ['e2e', '--preserve-symlinks'], { cwd: appDir });
// `--preserve-symlinks` is needed due the symlinked `node_modules/` in each example.
// `--no-webdriver-update` is needed to preserve the ChromeDriver version already installed.
const args = ['e2e', '--preserve-symlinks', '--no-webdriver-update'];
const e2eSpawn = spawnExt('yarn', args, { cwd: appDir });
return e2eSpawn.promise.then(
function () {
fs.appendFileSync(outputFile, `Passed: ${appDir}\n\n`);

View File

@ -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": [],

View File

@ -10,7 +10,7 @@
"ngc": "ngc -p tsconfig.json",
"rollup": "rollup -f iife -c rollup.config.js -o dist/bundle.es2015.js",
"rollup:lazy": "rollup -f cjs -c rollup.lazy.config.js -o dist/lazy.bundle.es2015.js",
"postinstall": "webdriver-manager update --gecko false",
"postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG",
"preprotractor": "tsc -p e2e",
"protractor": "protractor e2e/protractor.config.js",
"serve": "lite-server -c e2e/browser.config.json",

View File

@ -22,7 +22,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",

View File

@ -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",

View File

@ -22,7 +22,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",

View File

@ -18,7 +18,8 @@
"scripts": {
"buildifier": "bazel build @com_github_bazelbuild_buildtools//buildifier && find . -type f \\( -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/com_github_bazelbuild_buildtools/buildifier/buildifier",
"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": {

View File

@ -33,7 +33,7 @@
"webpack": "^2.2.1"
},
"scripts": {
"postinstall": "webdriver-manager update --gecko false",
"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",

View File

@ -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 8.9.1
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 BAZEL_VERSION 0.8.1
setEnvVar SAUCE_CONNECT_VERSION 4.4.9
setEnvVar ANGULAR_CLI_VERSION 1.5.0-rc.2

View File

@ -37,7 +37,7 @@ travisFoldEnd "install-yarn"
# Install all npm dependencies according to yarn.lock
travisFoldStart "yarn-install"
node tools/npm/check-node-modules --purge || yarn install --frozen-lockfile --non-interactive
(node tools/npm/check-node-modules --purge && yarn update-webdriver) || yarn install --frozen-lockfile --non-interactive
travisFoldEnd "yarn-install"