-
-
Notifications
You must be signed in to change notification settings - Fork 111
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): karma is deprecated, find an alternative test runner #10497
Comments
Sadly, as of this moment at least, BrowserStack's tutorials for establishing JS unit testing still utilize Karma. https://www.browserstack.com/docs/automate/javascript-testing/getting-started That is, there's no quick and easy reference for migrating to an alternative approach compatible with their service. |
One of the leads from Karma's deprecation page - Web Test Runner - does have a BrowserStack plugin: https://modern-web.dev/docs/test-runner/browser-launchers/browserstack/ Web Test Runner says:
Looking into some of its other recommendations, a testing engine called Playwright is notably compatible. It's very focused on running the "latest and greatest", though - it won't be helpful for testing legacy browsers. That said, it could allow us to offload our "modern browser" section of tests onto the build agents, bypassing any Browserstack connectivity issues. It also has full Chromium, WebKit, and Firefox-engine support - runnable from all major platforms. Apparently, it can run tests under simulated mobile environments with WebKit and Chromium, too. The biggest issue I can see: it looks like it'll take some work to convert from the Karma test-specification format. But... that's just the nature of tech-debt, I guess. I suppose the option always did exist with Karma, but I just realized that it's totally possible to make one config that sets up Playwright launchers and BrowserStack launchers - it's not like we'd have to specify only one. It's not clear how it handles cases where BrowserStack launching fails to connect yet, though. |
Extra thing of coolness for Web Test Runner: https://modern-web.dev/guides/test-runner/code-coverage/#coverage-browser-support Runs against Chromium can give code coverage reports, and it does seem like the format is either |
A thought occurs: we have regular user testing now. Not only do we already have user & regression tests against Android 5.0 via Android Studio emulation... but BrowserStack does offer live testing, not just automation. We could just schedule semi-regular "test this live via BrowserStack" user tests / regression tests against specific legacy targets in order to validate that things still work on older devices. Essentially, it'd result in less-frequent legacy testing but still give us a semi-regular 'canary' for legacy-compat issues. From there, we could shift to only automatically testing against modern targets. I'm not saying it's ideal, but... it would certainly be a practical decision, if naught else, and keeping the tests fully on our build agents should certainly help with flaky connectivity issues. |
Another caveat: there doesn't seem to be a public teamcity-reporter for Web Test Runner. That said, they've got decent docs on how to DIY one, so it's not the end of the world. If we're willing to take a stronger shift in testing paradigm, use of
Huh. And, it turns out that They also have their own mocha-like test-definition structure we could use instead of driving things within mocha test-specs, though that of course means we hit the TC-reporter issue again. That said, their structure does make some nice guarantees about making sure the document is fully settled at each step, removing a lot of flakiness issues we've seen at times. |
Side Note: Karma sometimes eats all available memory on our build agents, for example today on ba-win10-64-s1-601:
|
See also #10494
The text was updated successfully, but these errors were encountered: