Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUM-3461 refactor: Replace core dependency in RUM with FeatureScope #1750

Merged

Conversation

ncreated
Copy link
Collaborator

What and why?

📦 Utilizing the change from #1744, this PR updates the whole RUM to depend on FeatureScope interface rather than DatadogCoreProtocol directly.

This will be leveraged in fatal App Hangs monitoring, where AppHangObserver will take a dependency on FeatureScope to access DataStore, Event Write Context and Telemetry.

How?

With FeatureScope being available during RUM feature registration (#1744), it is now injected into all downstream components in RUM including the Monitor and all message receivers.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests for Core, RUM, Trace, Logs, CR and WVT
  • Run unit tests for Session Replay
  • Run integration tests
  • Run smoke tests
  • Run tests for tools/

@ncreated ncreated self-assigned this Mar 26, 2024
Comment on lines -29 to +19
let core = PassthroughCoreMock(
bypassConsentExpectation: expectation(description: "Send Event Bypass Consent"),
messageReceiver: CrashReportReceiver.mockAny()
)
let receiver: CrashReportReceiver = .mockWith(featureScope: featureScope)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a common pattern in this PR. We change from testing message receivers as part of mocked core to testing them as individual units. 🧽 🧹

@ncreated ncreated marked this pull request as ready for review March 26, 2024 16:43
@ncreated ncreated requested review from a team as code owners March 26, 2024 16:44
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Mar 26, 2024

Datadog Report

Branch report: ncreated/RUM-3461/refactor-rum-to-depend-on-feature-scope
Commit report: 1aae88f
Test service: dd-sdk-ios

✅ 0 Failed, 2897 Passed, 0 Skipped, 11m 35.08s Wall Time
🔻 Test Sessions change in coverage: 12 decreased, 2 increased

🔻 Code Coverage Decreases vs Default Branch (12)

This report shows up to 5 code coverage decreases.

  • test DatadogInternalTests iOS 79.04% (-0.71%) - Details
  • test DatadogInternalTests tvOS 79.09% (-0.63%) - Details
  • test DatadogTraceTests tvOS 49.26% (-0.48%) - Details
  • test DatadogLogsTests iOS 45.5% (-0.44%) - Details
  • test DatadogTraceTests iOS 49.2% (-0.43%) - Details

Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Very nice! It's a better separation of concerns 👍

@ncreated ncreated merged commit a3a1d7f into develop Mar 28, 2024
8 checks passed
@ncreated ncreated deleted the ncreated/RUM-3461/refactor-rum-to-depend-on-feature-scope branch March 28, 2024 07:52
@maxep maxep mentioned this pull request Apr 10, 2024
8 tasks
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.

None yet

2 participants