Skip to content

✅ Create basePlugin tests#4395

Open
BeltranBulbarellaDD wants to merge 20 commits intomainfrom
beltran.bulbarella/refactor_plugin_tests
Open

✅ Create basePlugin tests#4395
BeltranBulbarellaDD wants to merge 20 commits intomainfrom
beltran.bulbarella/refactor_plugin_tests

Conversation

@BeltranBulbarellaDD
Copy link
Copy Markdown
Contributor

@BeltranBulbarellaDD BeltranBulbarellaDD commented Mar 25, 2026

Motivation

The plugin E2E test scenarios (Angular, Vue, React, Next.js) were duplicated across each framework's scenario file. Every plugin tested the same core router behaviors but each had its own copy.

Changes

  • Extracted the 6 common plugin test scenarios into test/e2e/scenario/plugins/basePluginTests.ts:
    The base tests are:

    • Tracks initial View
    • Normalizes dynamic routes and has correct referrer.
    • View contains Loading_time
    • Do not create a view when query params change.
    • Should create a new view when the dynamic url changes.
    • Reports client side errors.
  • Reorganized all plugin scenario files into a test/e2e/scenario/plugins/ subdirectory (angular, vue, react, nextjs, plugin).

  • Replaced id-based element selectors (#error-button) with data-testid attributes across all test apps.

  • Framework-specific tests that don't fit the shared suite remain in their own test.describe blocks (Angular nested routes / wildcard / error handler, React splat routes / vital events / error boundary details, Next.js parallel routes / server errors / global errors).

  • Removed all unused code from the tests apps.

  • Removed the firefox check on React tests.

Test instructions

# Build test apps first (required before running E2E)
yarn build:apps

# Run all plugin-related E2E scenarios
yarn test:e2e -g "angular|vue|react|nextjs"

# Or run each plugin file individually
yarn test:e2e --spec test/e2e/scenario/plugins/angularPlugin.scenario.ts
yarn test:e2e --spec test/e2e/scenario/plugins/vuePlugin.scenario.ts
yarn test:e2e --spec test/e2e/scenario/plugins/reactPlugin.scenario.ts
yarn test:e2e --spec test/e2e/scenario/plugins/nextjsPlugin.scenario.ts

Verify that all shared scenarios (initial load, dynamic route normalization, SPA loading time, hash-only nav, query-param-only nav, same-route different URLs, client error) pass for each framework.

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

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

cit-pr-commenter-54b7da bot commented Mar 25, 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.0085 0.0044 -48.24%
RUM - add action 0.0264 0.0132 -50.00%
RUM - add error 0.0247 0.0133 -46.15%
RUM - add timing 0.0053 0.0027 -49.06%
RUM - start view 0.0233 0.0136 -41.63%
RUM - start/stop session replay recording 0.0014 0.0007 -50.00%
Logs - log message 0.0306 0.0177 -42.16%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 25.97 KiB 27.72 KiB +1.75 KiB
RUM - add action 98.72 KiB 102.61 KiB +3.90 KiB
RUM - add timing 26.43 KiB 26.12 KiB -313 B
RUM - add error 85.28 KiB 105.42 KiB +20.15 KiB
RUM - start/stop session replay recording 26.30 KiB 25.74 KiB -571 B
RUM - start view 486.03 KiB 478.84 KiB -7.19 KiB
Logs - log message 92.85 KiB 97.71 KiB +4.86 KiB

🔗 RealWorld

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 bot commented Mar 25, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.61% (+0.00%)

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

@BeltranBulbarellaDD BeltranBulbarellaDD marked this pull request as ready for review March 26, 2026 10:38
@BeltranBulbarellaDD BeltranBulbarellaDD requested a review from a team as a code owner March 26, 2026 10:38
@BeltranBulbarellaDD
Copy link
Copy Markdown
Contributor Author

BeltranBulbarellaDD commented Mar 26, 2026

Also, blocked until PR is merged.
Update: Merged

@BeltranBulbarellaDD BeltranBulbarellaDD marked this pull request as draft March 26, 2026 10:45
@amortemousque
Copy link
Copy Markdown
Collaborator

Yeah nice! At first glance:

  • We could decouple routing and error in BasePluginTests. It would simplify config and let us use it even if only routing is implemented.
  • We could make sure the grouping of describe is more consistent (see screenshot).
Screenshot 2026-03-27 at 10 40 03

@BeltranBulbarellaDD
Copy link
Copy Markdown
Contributor Author

@codex pls review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 788dd91732

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BeltranBulbarellaDD BeltranBulbarellaDD marked this pull request as ready for review March 31, 2026 08:04
@BeltranBulbarellaDD BeltranBulbarellaDD changed the title Beltran.bulbarella/refactor plugin tests ✅ Create basePlugin tests Mar 31, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 788dd91732

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that 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.

5 participants