Skip to content

test(e2e): Add TurboModule sample coverage and e2e validation - #6549

Merged
alwx merged 4 commits into
mainfrom
alwx/improvement/6167
Aug 5, 2026
Merged

test(e2e): Add TurboModule sample coverage and e2e validation#6549
alwx merged 4 commits into
mainfrom
alwx/improvement/6167

Conversation

@alwx

@alwx alwx commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Uses samples/react-native/tm/ as the canonical fixture for verifying the TurboModule instrumentation stack end to end.

  • NativeSampleModule.add(a, b) (sync, C++) and NativePlatformSampleModule.getPlatform() (async, ObjC/Kotlin) added to the sample specs.
  • New "TurboModule Playground" screen on the Errors tab runs both inside a manual root span, renders the resulting turbo_module.* span attributes on device, and has throw-from-native buttons for the crash-context path.
  • The sample configures turboModuleContextIntegration with its own modules (the default only tracks RNSentry).
  • Maestro flow + Jest e2e test asserting the aggregated and per-method turbo_module.* attributes on the transaction envelope.
  • packages/core micro-benchmark printing per-call wrapper latency with and without tracking into the CI output.

The Maestro flow lives in samples/react-native/e2e/tests/, which runs from sample-application.yml and is already behind the ready-to-merge gate. The benchmark lives in packages/core rather than performance-tests/TestAppSentry/, which only measures app-start time and binary size on Sauce Labs and has no in-app latency harness.

💡 Motivation and Context

Closes #6167

💚 How did you test it?

  • packages/core: yarn jest test/turbomodule (new benchmark prints ~1.1us/call sync, ~1.3us/call async overhead) and the full suite.
  • samples/react-native: tsc --noEmit, oxlint, prettier --check, jest.
  • Native lint: clang-format, ktlint.
  • The new Maestro flow and e2e test have not been run on a device yet.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

Run the e2e job with the ready-to-merge label to validate the Maestro flow on iOS and Android.

Extends the sample TurboModules with a synchronous `NativeSampleModule.add`
and an asynchronous `NativePlatformSampleModule.getPlatform` so the whole
instrumentation stack can be exercised end to end.

- New "TurboModule Playground" screen on the Errors tab runs both calls inside
  a manual root span, renders the resulting `turbo_module.*` span attributes
  on device and offers throw-from-native buttons for the crash-context path.
- The sample now configures `turboModuleContextIntegration` with its own
  modules instead of relying on the default (which only tracks `RNSentry`).
- Maestro flow plus a Jest e2e test asserting the aggregated and per-method
  `turbo_module.*` attributes on the transaction envelope.
- Micro-benchmark printing the per-call latency of the TurboModule wrapper
  with and without tracking into the CI output.
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • test(e2e): Add TurboModule sample coverage and e2e validation by alwx in #6549
  • ci: Replace secrets: inherit with explicit SENTRY_AUTH_TOKEN pass by oioki in #6562
  • chore(deps): update Wizard to v7.0.0 by github-actions in #6558
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6553
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.26.14 to 2.28.0 by dependabot in #6554
  • chore(deps): bump fast-uri from 3.1.4 to 3.1.5 by dependabot in #6560
  • chore(deps): bump getsentry/craft from 2.26.14 to 2.28.0 by dependabot in #6556
  • chore(deps): bump ip-address from 10.2.0 to 10.4.0 by dependabot in #6557
  • chore(deps): bump undici from 6.27.0 to 6.28.0 by dependabot in #6559
  • chore(deps): bump actions/setup-java from 5.6.0 to 5.7.0 by dependabot in #6555
  • chore(deps): bump brace-expansion from 1.1.16 to 1.1.18 by dependabot in #6552
  • fix(expo): resolve plugin config when registered as bare '@sentry/react-native' by antonis in #6543
  • fix(ios): make the RNSentry SPEC CHECKSUM in Podfile.lock machine-independent by alwx in #6534
  • chore(deps): update Android SDK to v8.51.0 by github-actions in #6539
  • chore(deps): update Sentry Android Gradle Plugin to v6.17.0 by github-actions in #6544
  • feat(core): Extend TurboModule instrumentation to legacy NativeModules by alwx in #6504
  • feat(ios): Introduce enableMetricKit option by alwx in #6540

🤖 This preview updates automatically when you update the PR.

@alwx
alwx marked this pull request as ready for review August 3, 2026 06:50
@alwx

alwx commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

Comment thread samples/react-native/src/Screens/TurboModuleScreen.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 9c09228. Configure here.

Adds an integration-level test using real `SentrySpan`s that pins the
contract the sample screen relies on: `SentrySpan.end()` emits `spanEnd`
(where the integration writes the attributes) before it seals the span,
and core-created spans are never sealed, so the `turbo_module.*`
attributes are readable via `spanToJSON` right after `end()` and the
same values reach the transaction event.
@lucas-zimerman lucas-zimerman added the ready-to-merge Triggers the full CI test suite label Aug 4, 2026
@sentry

sentry Bot commented Aug 4, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.21.0 (101) Release

⚙️ sentry-react-native Build Distribution Settings

@lucas-zimerman lucas-zimerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@alwx
alwx merged commit 02aafd6 into main Aug 5, 2026
70 of 77 checks passed
@alwx
alwx deleted the alwx/improvement/6167 branch August 5, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sample app coverage and e2e validation

2 participants