diff --git a/.circleci/config.yml b/.circleci/config.yml index 79d45a14861b..809ca9935bd5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,8 +65,8 @@ var_10: &only_on_master # (Using the tag in not necessary when pinning by ID, but include it anyway for documentation purposes.) # **NOTE 2**: If you change the version of the docker images, also change the `cache_key` suffix. # **NOTE 3**: If you change the version of the `*-browsers` docker image, make sure the -# `CI_CHROMEDRIVER_VERSION_ARG` env var (in `.circleci/env.sh`) points to a ChromeDriver -# version that is compatible with the Chrome version in the image. +# `--versions.chrome` arg in `integration/bazel-schematics/test.sh` specifies a +# ChromeDriver version that is compatible with the Chrome version in the image. executors: default-executor: parameters: @@ -446,13 +446,13 @@ jobs: type: boolean default: false executor: - # Needed because the example e2e tests depend on Chrome. - name: browsers-executor + name: default-executor resource_class: xlarge parallelism: 5 steps: - custom_attach_workspace - init_environment + - install_chrome_libs # Install aio - run: yarn --cwd aio install --frozen-lockfile --non-interactive - when: @@ -631,12 +631,11 @@ jobs: - run: ./scripts/ci/publish-build-artifacts.sh aio_monitoring_stable: - # This job needs Chrome to be globally installed because the tests run with Protractor - # which does not load the browser through the Bazel webtesting rules. - executor: browsers-executor + executor: default-executor steps: - custom_attach_workspace - init_environment + - install_chrome_libs - run: setPublicVar_CI_STABLE_BRANCH - run: name: Check out `aio/` and yarn from the stable branch diff --git a/.circleci/env.sh b/.circleci/env.sh index 1b66e6412c3e..717a4c8f0150 100755 --- a/.circleci/env.sh +++ b/.circleci/env.sh @@ -19,11 +19,6 @@ setPublicVar CI_AIO_MIN_PWA_SCORE "95"; # This is the branch being built; e.g. `pull/12345` for PR builds. setPublicVar CI_BRANCH "$CIRCLE_BRANCH"; setPublicVar CI_BUILD_URL "$CIRCLE_BUILD_URL"; -# ChromeDriver version compatible with the Chrome version included in the docker image used in -# `.circleci/config.yml`. See http://chromedriver.chromium.org/downloads for a list of versions. -# This variable is intended to be passed as an arg to the `webdriver-manager update` command (e.g. -# `"postinstall": "webdriver-manager update $CI_CHROMEDRIVER_VERSION_ARG"`). -setPublicVar CI_CHROMEDRIVER_VERSION_ARG "--versions.chrome 79.0.3945.130"; setPublicVar CI_COMMIT "$CIRCLE_SHA1"; # `CI_COMMIT_RANGE` is only used on push builds (a.k.a. non-PR, non-scheduled builds and rerun # workflows of such builds). diff --git a/aio/content/examples/component-interaction/example-config.json b/aio/content/examples/component-interaction/example-config.json index 054f3cca4856..d56f4ce8b0d0 100644 --- a/aio/content/examples/component-interaction/example-config.json +++ b/aio/content/examples/component-interaction/example-config.json @@ -4,9 +4,10 @@ "cmd": "yarn", "args": [ "e2e", + "--protractor-config=e2e/protractor-puppeteer.conf.js", "--no-webdriver-update", "--port={PORT}" ] } ] -} \ No newline at end of file +} diff --git a/aio/content/examples/dependency-injection/example-config.json b/aio/content/examples/dependency-injection/example-config.json index 054f3cca4856..d56f4ce8b0d0 100644 --- a/aio/content/examples/dependency-injection/example-config.json +++ b/aio/content/examples/dependency-injection/example-config.json @@ -4,9 +4,10 @@ "cmd": "yarn", "args": [ "e2e", + "--protractor-config=e2e/protractor-puppeteer.conf.js", "--no-webdriver-update", "--port={PORT}" ] } ] -} \ No newline at end of file +} diff --git a/aio/content/examples/i18n/example-config.json b/aio/content/examples/i18n/example-config.json index 4b2197f432c9..408f4c2d0c67 100644 --- a/aio/content/examples/i18n/example-config.json +++ b/aio/content/examples/i18n/example-config.json @@ -5,9 +5,10 @@ "cmd": "yarn", "args": [ "e2e", + "--protractor-config=e2e/protractor-puppeteer.conf.js", "--no-webdriver-update", "--port={PORT}" ] } ] -} \ No newline at end of file +} diff --git a/aio/content/examples/service-worker-getting-started/example-config.json b/aio/content/examples/service-worker-getting-started/example-config.json index 0ebe5bd24e37..f6a1e8b45840 100644 --- a/aio/content/examples/service-worker-getting-started/example-config.json +++ b/aio/content/examples/service-worker-getting-started/example-config.json @@ -1,7 +1,7 @@ { "projectType": "service-worker", "e2e": [ - {"cmd": "yarn", "args": ["e2e", "--no-webdriver-update", "--port={PORT}"]}, + {"cmd": "yarn", "args": ["e2e", "--protractor-config=e2e/protractor-puppeteer.conf.js", "--no-webdriver-update", "--port={PORT}"]}, {"cmd": "yarn", "args": ["build", "--prod"]}, {"cmd": "node", "args": ["--eval", "assert(fs.existsSync('./dist/ngsw.json'), 'ngsw.json is missing')"]}, {"cmd": "node", "args": ["--eval", "assert(fs.existsSync('./dist/ngsw-worker.js'), 'ngsw-worker.js is missing')"]}, diff --git a/aio/karma.conf.js b/aio/karma.conf.js index 8a988059f489..6fd5f2f79b5d 100644 --- a/aio/karma.conf.js +++ b/aio/karma.conf.js @@ -35,10 +35,10 @@ module.exports = function (config) { ChromeHeadlessNoSandbox: { base: 'ChromeHeadless', // See /integration/README.md#browser-tests for more info on these args - flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'] - } + flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'], + }, }, - browsers: [process.env['CI'] ? 'ChromeHeadlessNoSandbox' : 'Chrome'], + browsers: ['ChromeHeadlessNoSandbox'], browserNoActivityTimeout: 60000, singleRun: false, restartOnFileChange: true, diff --git a/aio/scripts/audit-web-app.js b/aio/scripts/audit-web-app.js index a02ecd9db10f..f7607a0a87a3 100644 --- a/aio/scripts/audit-web-app.js +++ b/aio/scripts/audit-web-app.js @@ -27,10 +27,10 @@ */ // Imports -const puppeteer = require('puppeteer'); const lighthouse = require('lighthouse'); const printer = require('lighthouse/lighthouse-cli/printer'); const logger = require('lighthouse-logger'); +const puppeteer = require('puppeteer'); // Constants const AUDIT_CATEGORIES = ['accessibility', 'best-practices', 'performance', 'pwa', 'seo']; @@ -83,10 +83,8 @@ function formatScore(score) { } async function launchChromeAndRunLighthouse(url, flags, config) { - const browser = await puppeteer.launch({ - headless: true, - args: ['--remote-debugging-port=9222']}); - flags.port = browser.port; + const browser = await puppeteer.launch(); + flags.port = (new URL(browser.wsEndpoint())).port; try { return await lighthouse(url, flags, config); diff --git a/aio/tests/deployment/e2e/protractor.conf.js b/aio/tests/deployment/e2e/protractor.conf.js index 2654c527c6ac..472bbd23925b 100644 --- a/aio/tests/deployment/e2e/protractor.conf.js +++ b/aio/tests/deployment/e2e/protractor.conf.js @@ -14,11 +14,11 @@ exports.config = { suite: 'full', capabilities: { browserName: 'chrome', - chromeOptions: process.env['CI'] ? { + chromeOptions: { binary: require('puppeteer').executablePath(), // See /integration/README.md#browser-tests for more info on these args - args: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'] - } : {}, + args: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'], + }, }, directConnect: true, framework: 'jasmine', diff --git a/aio/tests/e2e/protractor.conf.js b/aio/tests/e2e/protractor.conf.js index 44eeffdc679b..56aed7bcad45 100644 --- a/aio/tests/e2e/protractor.conf.js +++ b/aio/tests/e2e/protractor.conf.js @@ -14,11 +14,11 @@ exports.config = { ], capabilities: { browserName: 'chrome', - chromeOptions: process.env['CI'] ? { + chromeOptions: { binary: require('puppeteer').executablePath(), // See /integration/README.md#browser-tests for more info on these args - args: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'] - } : {}, + args: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'], + }, }, directConnect: true, baseUrl: 'http://localhost:4200/', diff --git a/aio/tools/example-zipper/exampleZipper.js b/aio/tools/example-zipper/exampleZipper.js index 1dc43f16c656..1b055d67d1c6 100644 --- a/aio/tools/example-zipper/exampleZipper.js +++ b/aio/tools/example-zipper/exampleZipper.js @@ -112,6 +112,7 @@ class ExampleZipper { '!**/npm-debug.log', '!**/example-config.json', '!**/wallaby.js', + '!e2e/protractor-puppeteer.conf.js', // AOT related files '!**/aot/**/*.*', '!**/*-aot.*' diff --git a/aio/tools/examples/example-boilerplate.js b/aio/tools/examples/example-boilerplate.js index f1290ad2fbe4..9f847e87b66a 100644 --- a/aio/tools/examples/example-boilerplate.js +++ b/aio/tools/examples/example-boilerplate.js @@ -15,8 +15,9 @@ const BOILERPLATE_PATHS = { 'src/environments/environment.prod.ts', 'src/environments/environment.ts', 'src/assets/.gitkeep', 'browserslist', 'src/favicon.ico', 'karma.conf.js', 'src/polyfills.ts', 'src/test.ts', 'tsconfig.app.json', 'tsconfig.spec.json', - 'tslint.json', 'e2e/src/app.po.ts', 'e2e/protractor.conf.js', 'e2e/tsconfig.json', - '.editorconfig', 'angular.json', 'package.json', 'tsconfig.json', 'tslint.json' + 'tslint.json', 'e2e/src/app.po.ts', 'e2e/protractor-puppeteer.conf.js', + 'e2e/protractor.conf.js', 'e2e/tsconfig.json', '.editorconfig', 'angular.json', 'package.json', + 'tsconfig.json', 'tslint.json' ], systemjs: [ 'src/systemjs-angular-loader.js', 'src/systemjs.config.js', 'src/tsconfig.json', diff --git a/aio/tools/examples/example-boilerplate.spec.js b/aio/tools/examples/example-boilerplate.spec.js index 91cfd6b04487..85426d0f4537 100644 --- a/aio/tools/examples/example-boilerplate.spec.js +++ b/aio/tools/examples/example-boilerplate.spec.js @@ -10,7 +10,7 @@ describe('example-boilerplate tool', () => { const sharedDir = path.resolve(__dirname, 'shared'); const sharedNodeModulesDir = path.resolve(sharedDir, 'node_modules'); const BPFiles = { - cli: 19, + cli: 20, i18n: 2, universal: 2, systemjs: 7, diff --git a/aio/tools/examples/run-example-e2e.js b/aio/tools/examples/run-example-e2e.js index 5c48b81d1f04..d4a363392297 100644 --- a/aio/tools/examples/run-example-e2e.js +++ b/aio/tools/examples/run-example-e2e.js @@ -262,7 +262,13 @@ function runE2eTestsCLI(appDir, outputFile, bufferOutput, port) { const config = loadExampleConfig(appDir); const commands = config.e2e || [{ cmd: 'yarn', - args: ['e2e', '--prod', '--no-webdriver-update', `--port=${port || DEFAULT_CLI_EXAMPLE_PORT}`] + args: [ + 'e2e', + '--prod', + '--protractor-config=e2e/protractor-puppeteer.conf.js', + '--no-webdriver-update', + '--port={PORT}', + ], }]; let bufferedOutput = `\n\n============== AIO example output for: ${appDir}\n\n`; diff --git a/aio/tools/examples/shared/boilerplate/cli/e2e/protractor-puppeteer.conf.js b/aio/tools/examples/shared/boilerplate/cli/e2e/protractor-puppeteer.conf.js new file mode 100644 index 000000000000..cd7496e23635 --- /dev/null +++ b/aio/tools/examples/shared/boilerplate/cli/e2e/protractor-puppeteer.conf.js @@ -0,0 +1,19 @@ +// @ts-check +// A protractor config to use to run the tests using the Chrome version provided by `puppeteer`. +// This is useful to ensure deterministic runs on CI and locally. This file is ignored when creating +// StackBlitz examples and ZIP archives for each example. + +const {config} = require('./protractor.conf.js'); + +exports.config = { + ...config, + capabilities: { + ...config.capabilities, + chromeOptions: { + ...config.capabilities.chromeOptions, + binary: require('puppeteer').executablePath(), + // See /integration/README.md#browser-tests for more info on these args + args: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'], + }, + }, +}; diff --git a/aio/tools/examples/shared/package.json b/aio/tools/examples/shared/package.json index 7c0b589272ea..64c896fa52bc 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 $CI_CHROMEDRIVER_VERSION_ARG", + "webdriver:update": "node ../../../../scripts/webdriver-manager-update.js", "preinstall": "node ../../../../tools/yarn/check-yarn.js", "postinstall": "yarn webdriver:update" }, @@ -74,6 +74,7 @@ "lite-server": "^2.2.2", "lodash": "^4.16.2", "protractor": "^5.4.2", + "puppeteer": "2.1.1", "rimraf": "^2.5.4", "rollup": "^1.1.0", "rollup-plugin-commonjs": "^9.2.1", diff --git a/aio/tools/examples/shared/protractor.config.js b/aio/tools/examples/shared/protractor.config.js index 7a039e4111df..60f191e31fba 100644 --- a/aio/tools/examples/shared/protractor.config.js +++ b/aio/tools/examples/shared/protractor.config.js @@ -20,7 +20,12 @@ exports.config = { // Capabilities to be passed to the webdriver instance. capabilities: { - 'browserName': 'chrome', + browserName: 'chrome', + chromeOptions: { + binary: require('puppeteer').executablePath(), + // See /integration/README.md#browser-tests for more info on these args + args: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'], + }, }, // Framework to use. Jasmine is recommended. diff --git a/aio/tools/examples/shared/yarn.lock b/aio/tools/examples/shared/yarn.lock index 8a006e31417f..8e964e7d7061 100644 --- a/aio/tools/examples/shared/yarn.lock +++ b/aio/tools/examples/shared/yarn.lock @@ -450,6 +450,11 @@ dependencies: "@types/sizzle" "*" +"@types/mime-types@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.0.tgz#9ca52cda363f699c69466c2a6ccdaad913ea7a73" + integrity sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM= + "@types/mime@*": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.0.tgz#5a7306e367c539b9f6543499de8dd519fac37a8b" @@ -729,6 +734,11 @@ agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0: dependencies: es6-promisify "^5.0.0" +agent-base@5: + version "5.1.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c" + integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g== + agentkeepalive@^3.4.1: version "3.5.2" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.5.2.tgz#a113924dd3fa24a0bc3b78108c450c2abee00f67" @@ -1942,6 +1952,16 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" +concat-stream@1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + concat-stream@^1.5.0: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" @@ -2239,6 +2259,13 @@ debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: dependencies: ms "2.0.0" +debug@4, debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + debug@^3.0.0, debug@^3.2.5, debug@^3.2.6: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" @@ -2246,13 +2273,6 @@ debug@^3.0.0, debug@^3.2.5, debug@^3.2.6: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -2943,6 +2963,16 @@ extglob@^2.0.2, extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" +extract-zip@^1.6.6: + version "1.6.7" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.7.tgz#a840b4b8af6403264c8db57f4f1a74333ef81fe9" + integrity sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k= + dependencies: + concat-stream "1.6.2" + debug "2.6.9" + mkdirp "0.5.1" + yauzl "2.4.1" + extsprintf@1.3.0, extsprintf@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -2972,6 +3002,13 @@ faye-websocket@~0.11.1: dependencies: websocket-driver ">=0.5.1" +fd-slicer@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65" + integrity sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU= + dependencies: + pend "~1.2.0" + figgy-pudding@^3.1.0, figgy-pudding@^3.4.1, figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" @@ -3735,6 +3772,14 @@ https-proxy-agent@^2.2.1: agent-base "^4.1.0" debug "^3.1.0" +https-proxy-agent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" + integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== + dependencies: + agent-base "5" + debug "4" + humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -4887,6 +4932,11 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" +mime-db@1.43.0: + version "1.43.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" + integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== + "mime-db@>= 1.40.0 < 2": version "1.40.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" @@ -4906,6 +4956,13 @@ mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.15, mime-types@~2.1.16, dependencies: mime-db "~1.30.0" +mime-types@^2.1.25: + version "2.1.26" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" + integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== + dependencies: + mime-db "1.43.0" + mime-types@~2.1.18, mime-types@~2.1.19: version "2.1.20" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" @@ -4933,6 +4990,11 @@ mime@^1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mime@^2.0.3: + version "2.4.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" + integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== + mime@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369" @@ -5039,7 +5101,7 @@ mkdirp@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" -mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -5804,6 +5866,11 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= + performance-now@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" @@ -5939,6 +6006,11 @@ process@^0.11.0: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" +progress@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -6000,6 +6072,11 @@ proxy-addr@~2.0.4: forwarded "~0.1.2" ipaddr.js "1.9.0" +proxy-from-env@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" + integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4= + prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" @@ -6056,6 +6133,22 @@ punycode@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" +puppeteer@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-2.1.1.tgz#ccde47c2a688f131883b50f2d697bd25189da27e" + integrity sha512-LWzaDVQkk1EPiuYeTOj+CZRIjda4k2s5w4MK4xoH2+kgWV/SDlkYHmxatDdtYrciHUKSXTsGgPgPP8ILVdBsxg== + dependencies: + "@types/mime-types" "^2.1.0" + debug "^4.1.0" + extract-zip "^1.6.6" + https-proxy-agent "^4.0.0" + mime "^2.0.3" + mime-types "^2.1.25" + progress "^2.0.1" + proxy-from-env "^1.0.0" + rimraf "^2.6.1" + ws "^6.1.0" + q@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" @@ -8303,6 +8396,13 @@ ws@1.1.1: options ">=0.0.5" ultron "1.0.x" +ws@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" + integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== + dependencies: + async-limiter "~1.0.0" + ws@~3.3.1: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" @@ -8481,6 +8581,13 @@ yargs@~3.10.0: decamelize "^1.0.0" window-size "0.1.0" +yauzl@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005" + integrity sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU= + dependencies: + fd-slicer "~1.0.1" + yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" diff --git a/integration/bazel-schematics/test.sh b/integration/bazel-schematics/test.sh index bf5c1f5b43bc..964180929186 100755 --- a/integration/bazel-schematics/test.sh +++ b/integration/bazel-schematics/test.sh @@ -53,7 +53,9 @@ function testNonBazel() { yarn --cwd node_modules/@angular/cli version --new-version 0.0.0 --no-git-tag-version # re-add build-angular yarn add --dev file:../../../node_modules/@angular-devkit/build-angular - yarn webdriver-manager update --gecko=false --standalone=false ${CI_CHROMEDRIVER_VERSION_ARG:---versions.chrome 2.45} + # TODO: Find a way to use the Chrome version provided by `puppeteer` as the rest of the + # integration projects. See https://github.com/angular/angular/pull/35049 for details. + yarn webdriver-manager update --gecko=false --standalone=false --versions.chrome=79.0.3945.130; ng build --progress=false ng test --progress=false --watch=false ng e2e --configuration=production --webdriver-update=false diff --git a/scripts/puppeteer-chrome-versions.js b/scripts/puppeteer-chrome-versions.js index 77adc6847883..05ba526dd323 100644 --- a/scripts/puppeteer-chrome-versions.js +++ b/scripts/puppeteer-chrome-versions.js @@ -9,8 +9,8 @@ // Mapping of puppeteer releases to their default Chrome version // derived from https://github.com/puppeteer/puppeteer/blob/master/docs/api.md. -// The puppeteer package.json file the Chrome revision such as -// "chromium_revision": "722234" but this does not map easily to the Chrome +// The puppeteer package.json file contains the compatible Chrome revision such as +// "chromium_revision": "722234" but this does not map easily to the Chrome version // so we use this mapping here instead. module.exports = { "2.1.1": "80.0.3987.0", diff --git a/scripts/webdriver-manager-update.js b/scripts/webdriver-manager-update.js index 9357820209b9..d19bf65ce390 100755 --- a/scripts/webdriver-manager-update.js +++ b/scripts/webdriver-manager-update.js @@ -10,17 +10,19 @@ */ // Use process.cwd() so that this script is portable and can be used in /aio // where this will require /aio/node_modules/puppeteer -const puppeteerVersion = require(`${process.cwd()}/node_modules/puppeteer/package.json`).version; +const puppeteerPkgPath = require.resolve('puppeteer/package.json', {paths: [process.cwd()]}); +const puppeteerVersion = require(puppeteerPkgPath).version; const chromeVersionMap = require('./puppeteer-chrome-versions'); const spawnSync = require('child_process').spawnSync; const version = chromeVersionMap[puppeteerVersion]; if (!version) { - console.error(`[webdriver-manager-update.js] Error: Could not Chrome version for Puppeteer version '${puppeteerVersion}' in Chrome/Puppeteer version map. Please update /scripts/puppeteer-chrome-versions.js.`); + console.error(`[webdriver-manager-update.js] Error: Could not find Chrome version for Puppeteer version '${puppeteerVersion}' in Chrome/Puppeteer version map. Please update /scripts/puppeteer-chrome-versions.js.`); process.exit(1); } const args = [ + 'webdriver-manager', 'update', '--gecko=false', '--standalone=false', @@ -30,13 +32,12 @@ const args = [ ...process.argv.slice(2), ]; -const isWindows = process.platform === 'win32'; -const result = spawnSync(`${process.cwd()}/node_modules/.bin/webdriver-manager${isWindows ? '.cmd' : ''}`, args, {stdio: 'inherit'}); +const result = spawnSync('yarn', args, {shell: true, stdio: 'inherit'}); if (result.error) { - console.error(`[webdriver-manager-update.js] Call to 'webdriver-manager update ${args.join(' ')}' failed with error code ${result.error.code}`); + console.error(`[webdriver-manager-update.js] Call to 'yarn ${args.join(' ')}' failed with error code ${result.error.code}`); process.exit(result.status); } if (result.status) { - console.error(`[webdriver-manager-update.js] Call to 'webdriver-manager update ${args.join(' ')}' failed with error code ${result.status}`); + console.error(`[webdriver-manager-update.js] Call to 'yarn ${args.join(' ')}' failed with error code ${result.status}`); process.exit(result.status); -} +}