chore(ci): run karma on local headless browsers instead of BrowserStack - #453
Open
Essk wants to merge 2 commits into
Open
chore(ci): run karma on local headless browsers instead of BrowserStack#453Essk wants to merge 2 commits into
Essk wants to merge 2 commits into
Conversation
BrowserStack sessions never start, so the unit job hangs until the 6h GitHub timeout and CI has had no green run since Oct 2025. Removing the BROWSER_STACK_* env vars makes videojs-generate-karma-config fall back to karma-detect-browsers and use the runner's local browsers. No coverage is lost: scripts/karma.conf.js already deletes the Safari BrowserStack launchers and filters /^Safari/ from the browser list, so the effective BrowserStack set was just Chrome and Firefox, both of which run locally on ubuntu-latest. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ChromiumHeadless cannot start on ubuntu-latest runners (AppArmor unprivileged user namespace restriction, 'No usable sandbox!'), failing the run despite Chrome and Firefox passing every test. Chromium is the same engine as Chrome, so filtering it drops no coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI has had no green run since October 2025. The
ci (ubuntu-latest, unit)job hangs innpm run testand only ends when it hits the 6 hour GitHub timeout (example run).From the logs, the BrowserStack sessions never start, and karma waits for them forever. Why they never start hasn't been diagnosed — whether the account or credentials behind the
BROWSER_STACK_USERNAME/BROWSER_STACK_ACCESS_KEYsecrets are still valid isn't visible from the repo side. But the hang is avoidable entirely by skipping BrowserStack: with those env vars removed from the job,videojs-generate-karma-configfalls back tokarma-detect-browsersand runs the runner's local browsers.In our own player stack we've found that testing in real (cloud) browsers really only adds value for Safari-exclusive playback behaviour — native HLS, AirPlay integration and the like — and we've reworked our test stack to use headless browsers everywhere else, which made CI both faster and more stable. In this repo, the BrowserStack setup provides no Safari coverage anyway:
scripts/karma.conf.jsalready deletes the Safari BrowserStack launchers and filters/^Safari/out of the browser list, so the effective BrowserStack set was only Chrome and Firefox — both preinstalled onubuntu-latest.Change
BROWSER_STACK_*env vars from thecijob, sovideojs-generate-karma-configfalls back tokarma-detect-browsersand runs the runner's local (headless) browsers.Chromiumlaunchers alongside the existing Safari filter inscripts/karma.conf.js:ChromiumHeadlesscannot start onubuntu-latest(AppArmor blocks its sandbox with "No usable sandbox!") and it duplicates the Chrome coverage anyway.The BrowserStack launcher definitions are deliberately untouched, so anyone with working BrowserStack credentials can still use them locally — and if the repo's secrets are confirmed working again later, restoring the two env vars restores the old behavior.
Verification
Ran
npm run test:browserlocally with no BrowserStack credentials in the environment: karma detected and launched local Chrome Headless and all 337 tests passed per browser.This PR's own checks are the real proof —
pull_requestworkflows run from the merge ref, so theci (ubuntu-latest, unit)job below is running with this change applied: it passes in about a minute on both Chrome and Firefox (674 assertions total) instead of hanging for 6 hours.Unblocks #452, which cannot get a green CI run as things stand.
🤖 Generated with Claude Code