Skip to content

♻️ set global context in e2e worker setup#4380

Merged
thomas-lebeau merged 1 commit intomainfrom
thomas.lebeau/refactor-worker-setup-options
Mar 25, 2026
Merged

♻️ set global context in e2e worker setup#4380
thomas-lebeau merged 1 commit intomainfrom
thomas.lebeau/refactor-worker-setup-options

Conversation

@thomas-lebeau
Copy link
Copy Markdown
Collaborator

Motivation

E2E tests running with a service worker were not setting the global context (run_id, test_name) on the SDK instances inside the worker, unlike all other test setups (bundle, async, npm, microfrontend).

Changes

  • workerSetup now accepts SetupOptions (instead of WorkerOptions + separate context) and calls setGlobalContext after each SDK init, consistent with the other setups
  • createMockServerApp signature simplified to accept optional SetupOptions directly, replacing the individual remoteConfiguration, worker, and context parameters

Test instructions

  • Run worker-related E2E tests: yarn test:e2e -g "worker"

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 requested a review from a team as a code owner March 24, 2026 14:55
@thomas-lebeau thomas-lebeau marked this pull request as draft March 24, 2026 16:05
@thomas-lebeau
Copy link
Copy Markdown
Collaborator Author

/trigger-ci

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 bot commented Mar 24, 2026

View all feedbacks in Devflow UI.

2026-03-24 18:18:17 UTC ℹ️ Start processing command /trigger-ci


2026-03-24 18:18:33 UTC ℹ️ Branch synced on Gitlab

Branch thomas.lebeau/refactor-worker-setup-options was out-of-sync on Gitlab - it has been resynced


2026-03-24 18:18:35 UTC ℹ️ Gitlab pipeline started

Started pipeline #104183030

@datadog-official
Copy link
Copy Markdown

datadog-official bot commented Mar 24, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.31%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: cbde1a0 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da bot commented Mar 24, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum N/A 176.56 KiB N/A N/A N/A
Rum Profiler N/A 6.16 KiB N/A N/A N/A
Rum Recorder N/A 27.46 KiB N/A N/A N/A
Logs N/A 56.88 KiB N/A N/A N/A
Rum Slim N/A 132.19 KiB N/A N/A N/A
Worker N/A 23.63 KiB N/A N/A N/A
🚀 CPU Performance

Pending...

🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
addglobalcontext N/A 26.81 KiB N/A
addaction N/A 52.15 KiB N/A
addtiming N/A 26.44 KiB N/A
adderror N/A 55.33 KiB N/A
startstopsessionreplayrecording N/A 25.54 KiB N/A
startview N/A 463.25 KiB N/A
logmessage N/A 45.30 KiB N/A

🔗 RealWorld

@thomas-lebeau thomas-lebeau marked this pull request as ready for review March 25, 2026 09:34
@thomas-lebeau thomas-lebeau merged commit 7bbfb40 into main Mar 25, 2026
19 of 20 checks passed
@thomas-lebeau thomas-lebeau deleted the thomas.lebeau/refactor-worker-setup-options branch March 25, 2026 15:58
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 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