Repository navigation
🔥 [RUM-19778] Remove Karma (configuration, dependencies and Karma-only test helpers) - #5142
Conversation
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🔁 Datadog re-ran 🎯 Code Coverage (details) 🔗 Commit SHA: faf078d | Docs | View more details | Give us feedback! |
2702bc3 to
e6dae91
Compare
e6dae91 to
aa33c28
Compare
bd33481 to
358181f
Compare
19d1def to
bc8e9ab
Compare
bc8e9ab to
6d092c4
Compare
6d092c4 to
3a2c300
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
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.
🤖 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
3a2c300 to
faf078d
Compare
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit faf078d
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.jsjasmineSeedReporterPlugin.js,karmaDuplicateTestNameReporterPlugin.js,karmaSkippedFailedReporterPlugin.js,karmaUnexpectedErrorLogReporterPlugin.js) and theglobalThis/Object.hasOwnpolyfill fileskarma,karma-browserstack-launcher,karma-jasmine,karma-junit-reporter,karma-sourcemap-loader,karma-spec-reporter,karma-webpack, plusswc-loaderand@swc/core(added in ✨ [RUM-5500] React-router v7 support #3299 to transpile dependencies for Karma; nothing else uses them), and theirLICENSE-3rdparty.csventrieskarma-webpackupdate pins inrenovate.jsonand.github/dependabot.yml(RUM-3130)Kept:
test/unit/browsers.conf.ts(BrowserStack browser matrix, used by the Vitest BrowserStack config), andjasmine-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:
registerCleanupTaskruns tasks withonTestFinishedgetCurrentJasmineSpecis tracked fromforEach.ts(a setup file run for every test file)disableJasmineUncaughtExceptionTrackinguses Vitest-compatible listenersallJsonSchemasusesimport.meta.globinstead of webpack'srequire.context(no more JS +.d.tspair)vitestis declared as a devDependency of@datadog/browser-core, whose test helpers now import itFollow-up: migrate specs to the Vitest API (then drop the Jasmine shim).
Test instructions
Checklist