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

Inline error service action #827

Merged
merged 5 commits into from
May 10, 2024
Merged

Conversation

fractalwrench
Copy link
Contributor

Goal

Inlines the call to the InternalErrorService into InternalEmbraceLogger, which simplifies the code & avoids a call to an iterator each time the log function is called.

Testing

Updated existing test coverage.

@fractalwrench fractalwrench requested a review from a team as a code owner May 9, 2024 15:30
Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 54.47761% with 61 lines in your changes are missing coverage. Please review.

Project coverage is 81.00%. Comparing base (a1ef581) to head (f74d08b).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #827      +/-   ##
==========================================
- Coverage   81.39%   81.00%   -0.40%     
==========================================
  Files         427      426       -1     
  Lines       11391    11414      +23     
  Branches     1691     1690       -1     
==========================================
- Hits         9272     9246      -26     
- Misses       1411     1458      +47     
- Partials      708      710       +2     
Files Coverage Δ
...e/android/embracesdk/UnityInternalInterfaceImpl.kt 44.23% <ø> (-1.06%) ⬇️
...mbrace/android/embracesdk/anr/EmbraceAnrService.kt 94.11% <100.00%> (+0.11%) ⬆️
...embracesdk/anr/detection/UnbalancedCallDetector.kt 100.00% <100.00%> (ø)
...droid/embracesdk/arch/datasource/DataSourceImpl.kt 94.44% <100.00%> (+0.32%) ⬆️
...k/capture/crash/EmbraceUncaughtExceptionHandler.kt 90.00% <100.00%> (+1.11%) ⬆️
...racesdk/capture/metadata/EmbraceMetadataService.kt 83.98% <100.00%> (+0.06%) ⬆️
...mbracesdk/comms/delivery/EmbraceDeliveryService.kt 57.35% <100.00%> (ø)
...oid/embracesdk/injection/SdkObservabilityModule.kt 100.00% <ø> (ø)
...roid/embracesdk/internal/logs/EmbraceLogService.kt 94.69% <100.00%> (ø)
...io/embrace/android/embracesdk/logging/EmbLogger.kt 100.00% <100.00%> (ø)
... and 30 more

... and 10 files with indirect coverage changes

@@ -60,10 +63,7 @@ internal class LogRecordExporterTest {

sleep(3000)
}
Assert.assertTrue((fakeLogRecordExporter.exportedLogs?.size ?: 0) == 0)
Assert.assertTrue(fake.msgQueue.any {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If there were previous test logic that was inspecting what internal errors were logged, how do we do this now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be achieved with changes in #828 as it replaces the logger with an interface. IMO the check isn't super helpful here as it's just asserting that a message was logged. I would like to make it clearer that we are logging internal errors & make it easier to test, but that come in additional refactoring

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it. There should be other side effects that can be observed, eh? I suppose if logging is the only thing that isn't verified, it's not that bad.

Base automatically changed from inline-logcat-action to remove-dead-log-code May 10, 2024 08:09
Base automatically changed from remove-dead-log-code to rename-logger-actions May 10, 2024 08:09
Base automatically changed from rename-logger-actions to remove-strict-mode May 10, 2024 08:09
Base automatically changed from remove-strict-mode to master May 10, 2024 08:28
@fractalwrench fractalwrench force-pushed the inline-err-service-action branch 2 times, most recently from 7eefd31 to f44b97e Compare May 10, 2024 09:48
Copy link
Collaborator

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

LGTM

@fractalwrench fractalwrench merged commit 4ad54a8 into master May 10, 2024
4 checks passed
@fractalwrench fractalwrench deleted the inline-err-service-action branch May 10, 2024 15:32
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