Skip to content

✅ improve unit test setup#4149

Draft
BenoitZugmeyer wants to merge 3 commits intomainfrom
benoit/improve-unit-test-bundling
Draft

✅ improve unit test setup#4149
BenoitZugmeyer wants to merge 3 commits intomainfrom
benoit/improve-unit-test-bundling

Conversation

@BenoitZugmeyer
Copy link
Member

Motivation

For a long time, our unit test suite did not support to be built as a single bundle -- each .spec.ts files produced a separate bundle with their dependencies, so module-level variables were not shared between spec files.

This constraint caused maintenance issues in the past (see). It also prevents us from running global cleanups in the "forEach.spec.ts" file.

Changes

  • Make sure all tests are properly cleaned-up on exit
  • Remove the runtimeChunck: false option so karma-webpack is building mutualizing common dependencies between spec files
  • Also, introduce a --seed argument so we can run the spec files for a given seed without modifying the config file (useful for letting agents investigating test failures)

Test instructions

If CI is green, it should be good

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

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Feb 6, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 1 Test failed

makeRecorderApi recorder boot with automatic start starts recording when init() is called from Safari 12.1.2 (Mac OS 10.14.6) (Datadog) (Fix with Cursor)
Expected $.length = 2 to equal 1.
Expected $[0].metrics.result = 'aborted' to equal 'succeeded'.
<Jasmine>
webpack:///packages/rum/src/boot/recorderApi.spec.ts:91:52 <- /tmp/_karma_webpack_495919/commons.js:100432:60
asyncFunctionResume@[native code]
[native code]
promiseReactionJob@[native code]

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 02c399c | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/improve-unit-test-bundling branch from 59a5a75 to 9694209 Compare February 6, 2026 16:50
@cit-pr-commenter-54b7da
Copy link

cit-pr-commenter-54b7da bot commented Feb 6, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 168.98 KiB 168.97 KiB -3 B -0.00%
Rum Profiler 4.31 KiB 4.31 KiB 0 B 0.00%
Rum Recorder 24.54 KiB 24.54 KiB 0 B 0.00%
Logs 56.27 KiB 56.27 KiB -3 B -0.01%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 125.82 KiB 125.82 KiB -3 B -0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance

Pending...

🧠 Memory Performance

Pending...

🔗 RealWorld

@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/improve-unit-test-bundling branch from 9694209 to 4ddaa91 Compare February 6, 2026 17:12
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.

1 participant