Skip to content

Commit b4d0852

Browse files
devversionandrewseguin
authored andcommitted
build: switch to chromium provided in dev-infra package (#19565)
Switches the chromium version provided in the shared dev-infra package. This gives us better control over used versions, and we get RBE optimizations that have been applied to these browsers. Closes #19543.
1 parent 5b36bdd commit b4d0852

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

WORKSPACE

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ web_test_repositories()
8888
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")
8989

9090
browser_repositories(
91-
chromium = True,
91+
# Chrome is brought in by `@npm_dev_infra_private` for better version control and
92+
# RBE experience where individual browser archives per platform are provided.
93+
# TODO: Do the same for Firefox (but it is not used for local development): DEV-114
94+
chromium = False,
9295
firefox = True,
9396
)
9497

scripts/run-component-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if (local && (components.length > 1 || all)) {
6161
process.exit(1);
6262
}
6363

64-
const browserName = firefox ? 'firefox-local' : 'chromium-local';
64+
const browserName = firefox ? 'firefox-local' : 'chromium';
6565
const bazelBinary = `yarn -s ${watch ? 'ibazel' : 'bazel'}`;
6666
const configFlag = viewEngine ? '--config=view-engine' : '';
6767

tools/defaults.bzl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ def karma_web_test_suite(name, **kwargs):
163163
kwargs["srcs"] = ["@npm//:node_modules/tslib/tslib.js"] + getAngularUmdTargets() + kwargs.get("srcs", [])
164164
kwargs["deps"] = ["//tools/rxjs:rxjs_umd_modules"] + kwargs.get("deps", [])
165165

166+
# Set up default browsers if no explicit `browsers` have been specified.
167+
if not hasattr(kwargs, "browsers"):
168+
kwargs["tags"] = ["native"] + kwargs.get("tags", [])
169+
kwargs["browsers"] = [
170+
# Note: when changing the browser names here, also update the "yarn test"
171+
# script to reflect the new browser names.
172+
"@npm_angular_dev_infra_private//browsers:chromium",
173+
"@io_bazel_rules_webtesting//browsers:firefox-local",
174+
]
175+
166176
for opt_name in kwargs.keys():
167177
# Filter out options which are specific to "karma_web_test" targets. We cannot
168178
# pass options like "browsers" to the local web test target.
@@ -198,10 +208,11 @@ def karma_web_test_suite(name, **kwargs):
198208
def protractor_web_test_suite(flaky = True, **kwargs):
199209
_protractor_web_test_suite(
200210
flaky = flaky,
211+
browsers = ["@npm_angular_dev_infra_private//browsers:chromium"],
201212
**kwargs
202213
)
203214

204-
def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], tags = [], **kwargs):
215+
def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], **kwargs):
205216
# Always include a prebuilt theme in the test suite because otherwise tests, which depend on CSS
206217
# that is needed for measuring, will unexpectedly fail. Also always adding a prebuilt theme
207218
# reduces the amount of setup that is needed to create a test suite Bazel target. Note that the
@@ -245,12 +256,6 @@ def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], tags = [], **k
245256
deps = [
246257
"//test:angular_test_init",
247258
] + deps,
248-
browsers = [
249-
# Note: when changing the browser names here, also update the "yarn test"
250-
# script to reflect the new browser names.
251-
"@io_bazel_rules_webtesting//browsers:chromium-local",
252-
"@io_bazel_rules_webtesting//browsers:firefox-local",
253-
],
254259
bootstrap = [
255260
# This matches the ZoneJS bundles used in default CLI projects. See:
256261
# https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/application/files/src/polyfills.ts.template#L58
@@ -264,6 +269,5 @@ def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], tags = [], **k
264269
"@npm//:node_modules/zone.js/dist/zone-testing.js",
265270
"@npm//:node_modules/reflect-metadata/Reflect.js",
266271
] + bootstrap,
267-
tags = ["native"] + tags,
268272
**kwargs
269273
)

0 commit comments

Comments
 (0)