Skip to content

🔥 [RUM-19778] Remove Karma (configuration, dependencies and Karma-only test helpers) - #5142

Merged
thomas-lebeau merged 2 commits into
thomas.lebeau/vitest-wdio-bs-spikefrom
thomas.lebeau/remove-karma
Nov 19, 2026
Merged

thomas-lebeau merged 2 commits into
thomas.lebeau/vitest-wdio-bs-spikefrom
thomas.lebeau/remove-karma

Conversation

@thomas-lebeau

@thomas-lebeau thomas-lebeau commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Karma is deprecated (RUM-19766). With #5135 (unit) and #5136 (unit-bs), all unit tests run on Vitest, so the Karma setup is now unused. Stacked on #5136.

Closes RUM-19778

Changes

Removes what was only used by Karma:

  • test/unit/karma.base.conf.js, test/unit/karma.bs.conf.js
  • the Karma reporter plugins (jasmineSeedReporterPlugin.js, karmaDuplicateTestNameReporterPlugin.js, karmaSkippedFailedReporterPlugin.js, karmaUnexpectedErrorLogReporterPlugin.js) and the globalThis / Object.hasOwn polyfill files
  • dependencies: karma, karma-browserstack-launcher, karma-jasmine, karma-junit-reporter, karma-sourcemap-loader, karma-spec-reporter, karma-webpack, plus swc-loader and @swc/core (added in ✨ [RUM-5500] React-router v7 support #3299 to transpile dependencies for Karma; nothing else uses them), and their LICENSE-3rdparty.csv entries
  • the karma-webpack update pins in renovate.json and .github/dependabot.yml (RUM-3130)
  • stale Karma mentions in AGENTS.md and comments

Kept: test/unit/browsers.conf.ts (BrowserStack browser matrix, used by the Vitest BrowserStack config), and jasmine-core / @types/jasmine / eslint-plugin-jasmine (used by the Jasmine compatibility shim until specs are migrated to the Vitest API).

Merges the test helpers that had a Karma version and a Vitest copy (selected through aliases in the Vitest config) into a single Vitest implementation, and drops the aliases:

  • registerCleanupTask runs tasks with onTestFinished
  • getCurrentJasmineSpec is tracked from forEach.ts (a setup file run for every test file)
  • disableJasmineUncaughtExceptionTracking uses Vitest-compatible listeners
  • allJsonSchemas uses import.meta.glob instead of webpack's require.context (no more JS + .d.ts pair)
  • vitest is declared as a devDependency of @datadog/browser-core, whose test helpers now import it

Follow-up: migrate specs to the Vitest API (then drop the Jasmine shim).

⚠️ Written with an AI agent (Claude Code).

Test instructions

yarn
yarn test:unit                                # Vitest, unchanged
node scripts/check-licenses.ts                # dependencies and LICENSE-3rdparty.csv match
git grep -i karma -- ':!yarn.lock' ':!*CHANGELOG.md'   # only historical mentions left

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@thomas-lebeau
thomas-lebeau added this pull request to stack #5137 October 14, 2026 14:53
@thomas-lebeau thomas-lebeau changed the title 🔥 remove the karma configuration and dependencies 🔥 Remove the Karma configuration and dependencies Oct 14, 2026
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum Salesforce 192.85 KiB 192.85 KiB 0 B 0.00% ✅
Rum 192.82 KiB 192.82 KiB 0 B 0.00% ✅
Rum Salesforce Profiler 8.01 KiB 8.01 KiB 0 B 0.00% ✅
Rum Profiler 8.01 KiB 8.01 KiB 0 B 0.00% ✅
Rum Salesforce Recorder 32.62 KiB 32.62 KiB 0 B 0.00% ✅
Rum Recorder 32.62 KiB 32.62 KiB 0 B 0.00% ✅
Logs 60.25 KiB 60.25 KiB 0 B 0.00% ✅
Rum Slim 148.67 KiB 148.67 KiB 0 B 0.00% ✅
Worker 24.23 KiB 24.23 KiB 0 B 0.00% ✅
Rum Shopify 224.18 KiB 224.18 KiB 0 B 0.00% ✅
Rum Shopify Profiler 8.00 KiB 8.00 KiB 0 B 0.00% ✅
Rum Shopify Recorder 4.85 KiB 4.85 KiB 0 B 0.00% ✅

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔁 Datadog re-ran unit-bs: [edge] and unit-bs: [safari-desktop] after they failed. Both re-runs passed. View in Datadog

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 77.89% (-0.04%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: faf078d | Docs | View more details | Give us feedback!

@thomas-lebeau thomas-lebeau changed the title 🔥 Remove the Karma configuration and dependencies 🔥 Remove Karma (configuration, dependencies and Karma-only test helpers) Oct 14, 2026
@thomas-lebeau
thomas-lebeau force-pushed the thomas.lebeau/remove-karma branch from 2702bc3 to e6dae91 Compare October 15, 2026 14:37
@thomas-lebeau
thomas-lebeau force-pushed the thomas.lebeau/remove-karma branch from e6dae91 to aa33c28 Compare October 15, 2026 15:55
@thomas-lebeau
thomas-lebeau force-pushed the thomas.lebeau/remove-karma branch 16 times, most recently from bd33481 to 358181f Compare November 5, 2026 11:59
@thomas-lebeau thomas-lebeau changed the title 🔥 Remove Karma (configuration, dependencies and Karma-only test helpers) 🔥 [RUM-19778] Remove Karma (configuration, dependencies and Karma-only test helpers) Nov 5, 2026
@thomas-lebeau
thomas-lebeau force-pushed the thomas.lebeau/remove-karma branch 4 times, most recently from 19d1def to bc8e9ab Compare November 11, 2026 05:36
@thomas-lebeau
thomas-lebeau force-pushed the thomas.lebeau/remove-karma branch from bc8e9ab to 6d092c4 Compare November 12, 2026 06:03
@thomas-lebeau
thomas-lebeau force-pushed the thomas.lebeau/remove-karma branch from 6d092c4 to 3a2c300 Compare November 12, 2026 15:58
@thomas-lebeau
thomas-lebeau marked this pull request as ready for review November 19, 2026 10:27
@thomas-lebeau
thomas-lebeau requested a review from a team as a code owner November 19, 2026 10:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T10:47:00.574498Z faf078d New commits
🔒 Security Review ✅ Completed 2026-11-19T10:47:59.176707Z faf078d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-prod-us1-4 datadog-prod-us1-4 Bot 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.

Bits Code Review: PASS

More details

The consolidated helpers preserve the implementations already selected by Vitest aliases. Focused browser validation and the dependency/license check support removing the unused Karma tooling.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 3a2c300

Unit tests (`unit`) and BrowserStack unit tests (`unit-bs`) now run on
Vitest: remove what was only used by Karma.

- karma.base.conf.js, karma.bs.conf.js, the Karma reporter plugins and the
  globalThis / Object.hasOwn polyfill files
- karma*, swc-loader and @swc/core (only used to transpile dependencies
  for Karma) dependencies, and their LICENSE-3rdparty.csv entries
- the karma-webpack update pins in renovate.json and dependabot.yml
- stale Karma mentions in docs and comments
…iases

The Karma versions of the test helpers are dead code now: replace them with
their Vitest implementations and remove the aliases redirecting to the
copies in test/unit-vitest.

- registerCleanupTask: runs tasks with `onTestFinished`
- getCurrentJasmineSpec: tracked from forEach.ts (run for every test file)
- disableJasmineUncaughtExceptionTracking: Vitest-compatible listeners
- allJsonSchemas: `import.meta.glob` instead of webpack's `require.context`
  (no more JS + d.ts pair)
- vitest declared as a devDependency of @datadog/browser-core, which now
  imports it in test helpers
@thomas-lebeau
thomas-lebeau force-pushed the thomas.lebeau/remove-karma branch from 3a2c300 to faf078d Compare November 19, 2026 10:45

@datadog-prod-us1-4 datadog-prod-us1-4 Bot 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.

Bits Code Review: PASS

More details

The removed Karma files have no identified active consumers. The consolidated test helpers preserve the existing Vitest behavior for cleanup, spec tracking, error handling, and schema loading.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit faf078d

@thomas-lebeau
thomas-lebeau merged commit 5f09eef into main Nov 19, 2026
31 checks passed
@thomas-lebeau
thomas-lebeau deleted the thomas.lebeau/remove-karma branch November 19, 2026 11:11
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants