Skip to content

Conversation

mormubis
Copy link
Contributor

@mormubis mormubis commented Oct 6, 2025

Motivation

The initial implementation of Worker E2E tests was somewhat tied to our specific use case and will not scale if we need to test different scenarios within the Worker environment.

Changes

It introduces a version of withWorker that automatically sets up the logs inside the worker. We can also pass an implementation, similar to what we do with withLogs and withBody.

Test instructions

All e2e still passed.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

Copy link

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 162.28 KiB 162.28 KiB 0 B 0.00%
Rum Recorder 19.92 KiB 19.92 KiB 0 B 0.00%
Rum Profiler 4.89 KiB 4.89 KiB 0 B 0.00%
Logs 55.96 KiB 55.96 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 119.25 KiB 119.25 KiB 0 B 0.00%
Worker 23.60 KiB 23.60 KiB 0 B 0.00%
🚀 CPU Performance

Pending...

🧠 Memory Performance

Pending...

🔗 RealWorld

Copy link

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 100.00%
Total Coverage: 92.68% (+0.01%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 35fd80d | Docs | Was this helpful? Give us feedback!

@mormubis mormubis marked this pull request as ready for review October 6, 2025 12:56
@mormubis mormubis requested a review from a team as a code owner October 6, 2025 12:56
@mormubis mormubis changed the title refactor: change e2e implementation for workers 👷 change e2e implementation for workers Oct 6, 2025
servers: Servers,
setup: string,
remoteConfiguration?: RemoteConfiguration
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't an interface be more readable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could definitely transform it to a type/interface.

createTest('service worker with worker logs - esm')
.withWorker()
.withLogs()
.withWorker(
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to move this to the createTest? So that we do something like:
.withWorker({ isModule: true, handleMessageWith: 'logger' })
Similar to what we do in:

.withExtension(createExtension(path.join(BASE_PATH, name)).withRum().withLogs())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the idea is to avoid that scenario and be more generic, or that's what I understood from @bcaudan feedback.

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