Skip to content

chore(ci): run karma on local headless browsers instead of BrowserStack - #453

Open
Essk wants to merge 2 commits into
mainfrom
chore/ci-drop-browserstack
Open

chore(ci): run karma on local headless browsers instead of BrowserStack#453
Essk wants to merge 2 commits into
mainfrom
chore/ci-drop-browserstack

Conversation

@Essk

@Essk Essk commented Aug 12, 2026

Copy link
Copy Markdown

Why

CI has had no green run since October 2025. The ci (ubuntu-latest, unit) job hangs in npm run test and 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_KEY secrets 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-config falls back to karma-detect-browsers and 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.js already 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 on ubuntu-latest.

Change

  • Drop the two BROWSER_STACK_* env vars from the ci job, so videojs-generate-karma-config falls back to karma-detect-browsers and runs the runner's local (headless) browsers.
  • Filter Chromium launchers alongside the existing Safari filter in scripts/karma.conf.js: ChromiumHeadless cannot start on ubuntu-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:browser locally 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_request workflows run from the merge ref, so the ci (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

Essk and others added 2 commits August 12, 2026 11:47
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>

@amtins amtins left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants