Skip to content

✅ [PANA-6831] Support the Change data format in E2E tests#4447

Open
sethfowler-datadog wants to merge 1 commit intoseth.fowler/PANA-6846-make-whitespace-consistent-between-e2e-setupsfrom
seth.fowler/PANA-6831-support-change-records-in-e2e-tests
Open

✅ [PANA-6831] Support the Change data format in E2E tests#4447
sethfowler-datadog wants to merge 1 commit intoseth.fowler/PANA-6846-make-whitespace-consistent-between-e2e-setupsfrom
seth.fowler/PANA-6831-support-change-records-in-e2e-tests

Conversation

@sethfowler-datadog
Copy link
Copy Markdown
Contributor

Motivation

As we transition away from the old V1 session replay data format and to the new Change format, we need to update all tests to support both formats. (Eventually, we'll remove the V1 tests, but we're not quite there yet.) The E2E tests currently don't support the Change data format, so we need to update them.

Changes

This PR updates all recording E2E tests that involve DOM mutations to support both the V1 and Change data formats.

I used one of two strategies.

For tests which involve nothing but full or incremental DOM mutations, I split the test into two totally separate implementations, one for the V1 format and one for the Change format. I switched to a snapshot testing model for the Change format implementation; my experience is that for these kinds of data format tests, this approach is the most effective at catching bugs and makes maintenance easy.

Some tests involve a mix of DOM mutations and other kinds of incremental mutations. Because only DOM mutations have been converted to use the new Change format, these tests mix together records with very different formats. This makes snapshot testing a bit awkward for now; it's easier to write specific assertions. For these tests, I used a unified implementation for both the V1 and Change formats, and relied on helpers that have different code paths internally to support both cases.

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

@sethfowler-datadog sethfowler-datadog requested review from a team as code owners April 6, 2026 16:13
@datadog-prod-us1-4
Copy link
Copy Markdown

datadog-prod-us1-4 bot commented Apr 6, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Other Violations

🧪 1 Test failed

serializeNodeAsChange for snapshotted documents for a simple document when the <html> element's privacy level is MASK_USER_INPUT matches the snapshot from Edge 80.0.361.62 (Windows 10)   View in Datadog   (Fix with Cursor)
Error: Timeout - Async function did not complete within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
    at <Jasmine>

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 77.12% (-0.49%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3ac1d97 | 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 Apr 6, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 177.94 KiB 177.94 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.03 KiB 27.03 KiB 0 B 0.00%
Logs 56.40 KiB 56.40 KiB 0 B 0.00%
Rum Slim 133.81 KiB 133.81 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0043 0.0052 +20.93%
RUM - add action 0.0133 0.0193 +45.11%
RUM - add error 0.0148 0.0181 +22.30%
RUM - add timing 0.0028 0.0043 +53.57%
RUM - start view 0.013 0.0153 +17.69%
RUM - start/stop session replay recording 0.0007 0.0008 +14.29%
Logs - log message 0.0182 0.017 -6.59%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 27.08 KiB 26.01 KiB -1.07 KiB
RUM - add action 99.24 KiB 90.54 KiB -8.70 KiB
RUM - add timing 26.89 KiB 26.51 KiB -387 B
RUM - add error 92.53 KiB 91.74 KiB -802 B
RUM - start/stop session replay recording 25.81 KiB 25.74 KiB -78 B
RUM - start view 485.69 KiB 484.42 KiB -1.27 KiB
Logs - log message 94.22 KiB 96.75 KiB +2.54 KiB

🔗 RealWorld

@sethfowler-datadog sethfowler-datadog force-pushed the seth.fowler/PANA-6831-support-change-records-in-e2e-tests branch from 85031ef to 3ac1d97 Compare April 7, 2026 11:36
@sethfowler-datadog sethfowler-datadog changed the base branch from main to seth.fowler/PANA-6846-make-whitespace-consistent-between-e2e-setups April 7, 2026 11:37
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