Skip to content
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

chore(web): enable testing against legacy devices via BrowserStack #11845

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

jahorton
Copy link
Contributor

@jahorton jahorton commented Jun 21, 2024

Fixes #11501.

Well, not completely... but close enough to merit closing the issue, I suppose.

My progress has been impeded somewhat due to issues I documented in modernweb-dev/web#2756. There are some limitations I'd rather not have, but at least things are far enough along to unblock progress.

Some neat things: we actually get more data about the test runs within the BrowserStack dashboard now, along with greater control of test-run labeling. A rough glimpse of that:

  1. As our test runs do have separate test sets for specific modules, we can label which module each run is for while keeping them all associated within the same overall build version label.

    image

  2. How about some neat network logs? This way, we can see what sort of load times different parts of the test suites are costing to have better data for setting timeouts and/or determining sources of related instability.

    image

  3. Even the "Text Logs" provide us a little more information than they used to.

  4. Console logs? Sure, why not?

    image

    Messages were temporarily added while I was analyzing the issues that led to [@web/test-runner-browserstack] + [@web/dev-server-legacy]: issues when using BrowserStack launcher for targeting certain older devices modernweb-dev/web#2756.

Note that a new package had to be added in order to support the older version of Chrome used here as a test target - @web/dev-server-legacy. It seems simple on the surface, but its dependencies are the source of the monstrous set of changes to package-lock.json.

@keymanapp-test-bot skip

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Jun 21, 2024
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Jun 21, 2024

User Test Results

Test specification and instructions

User tests are not required

@@ -9,6 +9,7 @@
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@web/dev-server-esbuild": "^1.0.2",
"@web/dev-server-import-maps": "^0.2.0",
"@web/dev-server-legacy": "^2.1.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems small on the surface, but comes with a very significant dependency cost - just look at the "lines changed" count for package-lock.json!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so I am not keen on this. Yeah, it's a dev dependency, but it's gonna cost us significantly in dependabot and more. Adding dependencies needs to go through review and cost/benefit analysis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So... should I put this back in draft, pending such a review? Or just abandon this and close out the issue as a wontfix?

We can't reasonably test against older Chrome versions without it, which kinda defeats our main reason to do remote testing against BrowserStack.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is relatively easy to download older versions of Chromium and test on those -- which I think would be sufficient. That then resolves the need to drag in 5,000 new lines of dependencies into package-lock.json and probably removes most of our BrowserStack requirement altogether?

// you can get the browser capabilities from the browserstack website
browserstackLauncher({
capabilities: {
// Requires the dev-server-legacy plugin to operate properly.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, for this older version of Chrome. Supposedly, version 63 or 64 would allow us to drop it, but I'd want to check that experimentally first.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

force-push means I cannot see the context here... But I think you mean version 57 right?

@darcywong00 darcywong00 modified the milestones: A18S4, A18S5 Jun 21, 2024
@jahorton jahorton force-pushed the chore/web/restore-legacy-auto-testing branch from 79fd953 to 45b1f73 Compare June 25, 2024 08:17
@jahorton
Copy link
Contributor Author

Test (Keyman - iOS) build failure cause:

15:38:43   /opt/homebrew/Cellar/fastlane/2.220.0/libexec/gems/fastlane-2.220.0/spaceship/lib/spaceship/connect_api/api_client.rb:250:in `handle_error': [!] The request could not be completed because: (Spaceship::ProgramLicenseAgreementUpdated)
15:38:43     A required agreement is missing or has expired. - This request requires an in-effect agreement that has not been signed or has expired.

From https://build.palaso.org/buildConfiguration/Keyman_iOS_TestPullRequests/474686?buildTab=log&linesState=2357.2448&logView=flowAware&focusLine=2565

@darcywong00 darcywong00 modified the milestones: A18S5, A18S6 Jul 5, 2024
@darcywong00 darcywong00 modified the milestones: A18S6, A18S7 Jul 19, 2024
@darcywong00 darcywong00 modified the milestones: A18S7, A18S8 Aug 2, 2024
@jahorton jahorton force-pushed the chore/web/restore-legacy-auto-testing branch from 8618845 to 77d075a Compare August 13, 2024 05:07
@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-missing User tests have not yet been defined for the PR label Aug 13, 2024
@jahorton
Copy link
Contributor Author

Note: I haven't gotten it working perfectly yet. Over the course of a day, the test targets aside from the first - Chrome on Windows - tend to stop connecting, then later start working again. It appears that the test-runner will sometimes just... force-quit when this happens, with no further info provided or obtainable. (Our custom reporter's stop method is even bypassed completely.)

So, it's not stable, thus not "good enough" to connect to CI... but it gets us much closer to where we were before we shifted from using Karma to BrowserStack.

@jahorton jahorton marked this pull request as ready for review August 13, 2024 05:19
@jahorton jahorton changed the title chore(web): restore testing against legacy devices via BrowserStack chore(web): enable testing against legacy devices via BrowserStack Aug 13, 2024
browsers: [
// create a browser launcher per browser you want to test
// you can get the browser capabilities from the browserstack website
browserstackLauncher({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no named() for this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I had it working before, but the names aren't actually showing up from the reporter. So, I didn't bother. 🤷

@darcywong00 darcywong00 modified the milestones: A18S8, A18S9 Aug 17, 2024
@jahorton
Copy link
Contributor Author

jahorton commented Aug 21, 2024

Oof, that was quite the merge conflict; this branch started before @ermshiperete's recent reorganization work. I'm pushing now and will use the "changed files" view as a guide for further merge cleanup.

@@ -9,6 +9,7 @@
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@web/dev-server-esbuild": "^1.0.2",
"@web/dev-server-import-maps": "^0.2.0",
"@web/dev-server-legacy": "^2.1.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so I am not keen on this. Yeah, it's a dev dependency, but it's gonna cost us significantly in dependabot and more. Adding dependencies needs to go through review and cost/benefit analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

chore(web): re-establish BrowserStack testing for legacy browser support
4 participants