Skip to content

Commit 72c3695

Browse files
gkalpakmatsko
authored andcommitted
ci: pin ChromeDriver to a version compatible with docker image's Chrome (angular#28494)
By default, `webdriver-manager update` will download the latest ChromeDriver version, which might not be compatible with the Chrome version included in the [docker image used on CI], causing CI failures. Previously, we used to pin the ChromeDriver version on CI in [ngcontainer's Dockerfile][2]. This was accidentally broken in angular#26691, while moving from ngcontainer to default CircleCI docker images. This commit fixes the issue by pinning ChromeDriver to a known compatible version. [1]: https://github.com/angular/angular/blob/bfd48d156d5663cc49d1ec40c2d73ff76a2fe62f/.circleci/config.yml#L16 [2]: https://github.com/angular/angular/blob/bfd48d156d5663cc49d1ec40c2d73ff76a2fe62f/tools/ngcontainer/Dockerfile#L63 PR Close angular#28494
1 parent 895a8d6 commit 72c3695

File tree

14 files changed

+24
-15
lines changed

14 files changed

+24
-15
lines changed

.circleci/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
# needed for jobs that run tests without Bazel. Bazel runs tests with browsers that will be
1212
# fetched by the Webtesting rules. Therefore for jobs that run tests with Bazel, we don't need a
1313
# docker image with browsers pre-installed.
14-
# **NOTE**: If you change the version of the docker images, also change the `cache_key` suffix.
14+
# **NOTE 1**: If you change the version of the `*-browsers` docker image, make sure the
15+
# `CI_CHROMEDRIVER_VERSION_ARG` env var (in `.circleci/env.sh`) points to a ChromeDriver
16+
# version that is compatible with the Chrome version in the image.
17+
# **NOTE 2**: If you change the version of the docker images, also change the `cache_key` suffix.
1518
var_1: &default_docker_image circleci/node:10.12
1619
var_2: &browsers_docker_image circleci/node:10.12-browsers
1720
var_3: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-node-10.12

.circleci/env.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ setPublicVar PROJECT_ROOT "$(pwd)";
1818
setPublicVar CI_AIO_MIN_PWA_SCORE "95";
1919
# This is the branch being built; e.g. `pull/12345` for PR builds.
2020
setPublicVar CI_BRANCH "$CIRCLE_BRANCH";
21+
# ChromeDriver version compatible with the Chrome version included in the docker image used in
22+
# `.circleci/config.yml`. See http://chromedriver.chromium.org/downloads for a list of versions.
23+
# This variable is intended to be passed as an arg to the `webdriver-manager update` command (e.g.
24+
# `"postinstall": "webdriver-manager update $CI_CHROMEDRIVER_VERSION_ARG"`).
25+
setPublicVar CI_CHROMEDRIVER_VERSION_ARG "--versions.chrome 2.45";
2126
setPublicVar CI_COMMIT "$CIRCLE_SHA1";
2227
# `CI_COMMIT_RANGE` will only be available when `CIRCLE_COMPARE_URL` is also available (or can be
2328
# retrieved via `get-compare-url.js`), i.e. on push builds (a.k.a. non-PR, non-scheduled builds and

aio/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"generate-stackblitz": "node ./tools/stackblitz-builder/generateStackblitz",
6363
"generate-zips": "node ./tools/example-zipper/generateZips",
6464
"build-404-page": "node scripts/build-404-page",
65-
"update-webdriver": "webdriver-manager update --standalone false --gecko false $CHROMEDRIVER_VERSION_ARG",
65+
"update-webdriver": "webdriver-manager update --standalone false --gecko false $CI_CHROMEDRIVER_VERSION_ARG",
6666
"~~check-env": "node scripts/check-environment",
6767
"~~clean-generated": "node --eval \"require('shelljs').rm('-rf', 'src/generated')\"",
6868
"~~build": "ng build --configuration=stable",

aio/tools/examples/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"http-server": "http-server",
88
"protractor": "protractor",
9-
"webdriver:update": "webdriver-manager update --standalone false --gecko false $CHROMEDRIVER_VERSION_ARG",
9+
"webdriver:update": "webdriver-manager update --standalone false --gecko false $CI_CHROMEDRIVER_VERSION_ARG",
1010
"preinstall": "node ../../../../tools/yarn/check-yarn.js",
1111
"postinstall": "yarn webdriver:update"
1212
},

integration/bazel-schematics/test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function testBazel() {
1111
node replace_angular_repo.js "./demo/WORKSPACE"
1212
cd demo
1313
yarn add @angular/bazel@file:../../../dist/packages-dist/bazel
14+
yarn webdriver-manager update --gecko=false --standalone=false $CI_CHROMEDRIVER_VERSION_ARG
1415
cp ../package.json.replace ./package.json
1516
ng generate component widget --style=css
1617
ng build
@@ -24,7 +25,7 @@ function testNonBazel() {
2425
rm -rf dist src/main.dev.ts src/main.prod.ts
2526
ng build --progress=false
2627
ng test --progress=false --watch=false
27-
ng e2e --configuration=ci
28+
ng e2e --configuration=ci --webdriver-update=false
2829
}
2930

3031
testBazel

integration/cli-hello-world-ivy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"e2e": "ng e2e --webdriver-update=false",
88
"lint": "ng lint",
99
"ng": "ng",
10-
"postinstall": "webdriver-manager update --gecko=false --standalone=false $CHROMEDRIVER_VERSION_ARG && yarn ivy-ngcc",
10+
"postinstall": "webdriver-manager update --gecko=false --standalone=false $CI_CHROMEDRIVER_VERSION_ARG && yarn ivy-ngcc",
1111
"start": "ng serve",
1212
"pretest": "ng version",
1313
"//test1": "TODO FW-813: Re-enable `ci-production`. Currently, it fails after a timeout as Protractor reports Angular cannot be found on the page",

integration/cli-hello-world/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"e2e": "ng e2e --webdriver-update=false",
88
"lint": "ng lint",
99
"ng": "ng",
10-
"postinstall": "webdriver-manager update --gecko=false --standalone=false $CHROMEDRIVER_VERSION_ARG",
10+
"postinstall": "webdriver-manager update --gecko=false --standalone=false $CI_CHROMEDRIVER_VERSION_ARG",
1111
"start": "ng serve",
1212
"pretest": "ng version",
1313
"test": "ng test --progress=false --watch=false && yarn e2e --configuration=ci && yarn e2e --configuration=ci-production"

integration/dynamic-compiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"ngc": "ngc -p tsconfig.json",
1111
"rollup": "rollup -f iife -c rollup.config.js -o dist/bundle.es2015.js",
1212
"rollup:lazy": "rollup -f cjs -c rollup.lazy.config.js -o dist/lazy.bundle.es2015.js",
13-
"postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG",
13+
"postinstall": "webdriver-manager update --gecko false --standalone false $CI_CHROMEDRIVER_VERSION_ARG",
1414
"preprotractor": "tsc -p e2e",
1515
"protractor": "protractor e2e/protractor.config.js",
1616
"serve": "lite-server -c e2e/browser.config.json",

integration/hello_world__closure/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"protractor": "file:../../node_modules/protractor"
2323
},
2424
"scripts": {
25-
"postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG",
25+
"postinstall": "webdriver-manager update --gecko false --standalone false $CI_CHROMEDRIVER_VERSION_ARG",
2626
"closure": "java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf",
2727
"test": "ngc && yarn run closure && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first",
2828
"serve": "lite-server -c e2e/browser.config.json",

integration/hello_world__systemjs_umd/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.0.0",
55
"license": "MIT",
66
"scripts": {
7-
"postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG",
7+
"postinstall": "webdriver-manager update --gecko false --standalone false $CI_CHROMEDRIVER_VERSION_ARG",
88
"test": "concurrently \"yarn serve\" \"yarn protractor\" --kill-others --success first",
99
"serve": "lite-server -c bs-config.e2e.json",
1010
"preprotractor": "tsc -p e2e",

integration/i18n/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
"protractor": "file:../../node_modules/protractor"
2424
},
2525
"scripts": {
26-
"postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG",
26+
"postinstall": "webdriver-manager update --gecko false --standalone false $CI_CHROMEDRIVER_VERSION_ARG",
2727
"closure": "java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf",
2828
"test": "ngc && yarn run closure && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first && npm run test-locale-folder",
2929
"test-locale-folder": "node test-locale-folder.js",
3030
"serve": "lite-server -c e2e/browser.config.json",
3131
"preprotractor": "tsc -p e2e",
3232
"protractor": "protractor e2e/protractor.config.js"
3333
}
34-
}
34+
}

integration/ng_elements/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"protractor": "file:../../node_modules/protractor"
2424
},
2525
"scripts": {
26-
"postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG",
26+
"postinstall": "webdriver-manager update --gecko false --standalone false $CI_CHROMEDRIVER_VERSION_ARG",
2727
"closure": "java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf",
2828
"test": "ngc && yarn run closure && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first",
2929
"serve": "lite-server -c e2e/browser.config.json",

integration/platform-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"webpack": "^2.2.1"
3535
},
3636
"scripts": {
37-
"postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG",
37+
"postinstall": "webdriver-manager update --gecko false --standalone false $CI_CHROMEDRIVER_VERSION_ARG",
3838
"build": "./build.sh",
3939
"test": "npm run build && concurrently \"npm run serve\" \"npm run protractor\" --kill-others --success first",
4040
"serve": "node built/server-bundle.js",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"bazel:lint-fix": "yarn bazel:format --lint=fix",
2222
"preinstall": "node tools/yarn/check-yarn.js",
2323
"postinstall": "yarn update-webdriver && node --preserve-symlinks --preserve-symlinks-main ./tools/postinstall-patches.js",
24-
"update-webdriver": "webdriver-manager update --gecko false $CHROMEDRIVER_VERSION_ARG",
24+
"update-webdriver": "webdriver-manager update --gecko false $CI_CHROMEDRIVER_VERSION_ARG",
2525
"check-env": "gulp check-env",
2626
"commitmsg": "node ./scripts/git/commit-msg.js",
2727
"test-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot",
@@ -151,4 +151,4 @@
151151
"resolutions": {
152152
"natives": "1.1.6"
153153
}
154-
}
154+
}

0 commit comments

Comments
 (0)