-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manually version browsers #74
Comments
Refs #74. https://github.com/angular/dev-infra/tree/1ad20ef9dd457de967252283c1a968b0d702d0ae/bazel/browsers/ This is the only existing example I could find which supports a setup for manually versioning browsers in the repository. It still has a dependency on `@io_bazel_rules_webtesting`, but hopefully we can break that eventually. This commit is a straight copy with *zero* modifications. The only difference is adding a `README` to describe where the fork came from. Any required changes will come in future commits.
Refs #74. We _must_ drop the `@io_bazel_rules_webtesting` `browser_repositories` call because it will download to the same Bazel repository names and conflict with the locally versioned browsers.
Refs #74. This is necessary for `web_test` to correctly run the tests. Both Chromium and Firefox seem to work with native.
Refs #74. This updates the Chromium browser to choose a forked configuration without `--headless` when in debug mode. This way the browser can be inspected during tests. For some reason, `--//tools/browsers:use_debug_browers` needed to be enabled manually. I thought this enabled by `--config debug`, but apparently not. I've added it to `debug.bazelrc` to make this more automatic.
Refs #74. This updates the WebDriver library to dynamically read the current browser from the environment and then set up WebDriver for that browser. This makes it work with Chromium or Firefox without hard-coding either browser.
Refs #74. Implemented as just an alias for now, will refactor afterwards.
Refs #74. This is to align with the version used in Angular Dev Infra's browser update tool. Also it's just a good upgrade to do. The API changed slightly in Yargs, and we need to explicitly stay synchronous with `.parseSync`. I took the opportunity to standardize some of the formatting on the various tools. Also adds `.strict()` which I just discovered and which ensures no unknown commands are passed.
Refs #74. This is a straight copy of the relevant files with no modifications made to the files to be clear about changes in subsequent diffs. The only difference is that the files are named `*.mts` instead of `*.ts` to match existing repository conventions.
Refs #74. This migrates the build process to an `@aspect_rules_js`-based toolchain and installs the required dependencies. I opted to just remove the `Spinner` class usage in order to break a dependency on Angular Dev Infra utils I didn't want to fork.
Refs #74. A decent portion of this script was dedicated to pushing the browser binaries to a mirror owned by Angular. We don't have permission to do that here so it can be dropped. I'm a little sad to drop the Firefox part, as it seems only Chrome is supported for pulling actual version numbers. I may try to revive that in the future if and when upgrading Firefox becomes an issue.
Refs #74. We don't want this dependency on Angular. Also removes a comment about Firefox download instructions, no such instructions exist either here or at the location we forked from.
Refs #74. This aligns conventions with the rest of the repo, but does not make any behavioral changes.
Refs #74. Hopefully I didn't break anything, these are fairly trivial changes.
Refs #74. Also updates `findLatestRevisionForAllPlatforms` to return an exit code, which I think is a little cleaner than the `process.exit` call.
Refs #74. This makes things more cacheable and explicit. I needed to break a circular dependency between `Browser` and `BrowserArtifact` to make this work. Also renamed the files to use `_` in the name to align with repository conventions.
Refs #74. This was likely used for publishing the content to NPM, but that's not a requirement here.
…code. Refs #74. This brings it in line with repository conventions.
Refs #74. Modifications were simply a find and replace to update `//bazel/constraints` -> `//tools/constraints`. No manual edits appear to be needed.
Refs #74. Modifications were just a find-and-replace of `//bazel/browsers` -> `//tools/browsers`. No manual modifications appear to be needed.
Refs #74. This reduces boilerplate and gives a set of "default" browsers to use for such tests.
Refs #74. For whatever reason, `web_test_suite` *requires* the target name to be explicit. `//foo:foo` is required instead of `//foo`. This appears to be an overly constrained string parsing behavior. To make this more usable, `jasmine_web_test_suite` now automatically expands any input targets from `//foo` to `//foo:foo` if necessary before passing them in to `web_test_suite`.
Refs #74. These were needed for browsers versioned by `@io_bazel_rules_webtesting` but now are never used. We only need tags for the locally versioned browser instances.
Refs #74. All usages have been migrated to `//tools/browsers/chromium`, so this is no longer needed.
Refs #74. Chrome originally shipped declarative shadow DOM with `shadowroot` as the relevant attribute name, however the spec changed to `shadowroot` and Chrome has deprecated the old behavior which will be removed soon. Therefore we should switch to `shadowrootmode` to align with the spec and support multiple browsers. See https://chromestatus.com/feature/6239658726391808. This also might enable streaming support for DSD in Chrome? https://chromestatus.com/feature/5161240576393216 This migration was mostly done via a find and replace with some manual sanity checks.
Refs #74. Unfortunately hardware accelleration seems to be crashing Firefox on GitHub actions.
I've made a lot of progress here and landed locally versioned browsers. Chromium and Firefox are versioned locally and run for all e2e tests by default successfully. I then was able to update First, Firefox works great locally, but I have yet to get it to successfully run in CI. I'm not entirely sure what's going on as I've whack-a-moled a few errors. The one I'm at now is:
I don't fully understand what this means, but
My takeaway is that it's failing to initialize, but I have no idea why or what to do to fix it. Resources on this are unfortunately pretty scarce. For now, I have Firefox tests running with the Second I wasn't able to break the dependency on For now, I'll close this issue and follow up on the Firefox thing separately. |
@io_bazel_rules_webtesting
doesn't appear to be maintained anymore and hasn't see a release in over 2 years. This means the version of downloaded browsers is falling out of date.It wouldn't be that big a deal, except that I've been using
<template shadowroot="open">
because that is what's supported in the version of Chrome used for testing. However, the spec was changed to use<template shadowrootmode="open">
and Chrome M119 is slated to remove support for<template shadowroot="open">
. This is currently scheduled for Nov 7th, per https://chromiumdash.appspot.com/schedule.As a result, I need to update my code to use
shadowrootmode
, which means I need a recent-enough browser version which supports that. I'm wondering if I can fork or build a simpler solution good enough for@rules_prerender
. This is definitely blocking 1.0.0 because I wouldn't want to ship that until I can useshadowrootmode
correctly.I have a prototype in
ref/browser-update
forked from an implementation in the Angular Dev Infra repository. This was sufficient to download recent versions of Chrome / Firefox and get a passing test withshadowrootmode
on Chrome.Some more things I'll need to figure out:
@rules_prerender
. It might be fine since I have the polyfill, and could serve as a test case for that. But we may want to think about how much value this is actually giving and whether or not its worth it.@rules_prerender
. I'll want to refactor things to make it more maintainable and aligned with the rest of the codebase.shadowrootmode
- Once everything is stable, I should be able to migrate all usages ofshadowroot
toshadowrootmode
.@io_bazel_rules_webtesting
dependency - If possible, I should also look into breaking the dependency on@io_bazel_rules_webtesting
entirely. Unfortunately the Angular implementation does still rely on a few exported symbols from that ruleset, even if it versions its own browsers. It would be great to drop that dependency altogether.The text was updated successfully, but these errors were encountered: