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
Improve test coverage for OpenTelemetry #2401
Conversation
|
Codecov ReportBase: 80.04% // Head: 80.38% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2401 +/- ##
============================================
+ Coverage 80.04% 80.38% +0.33%
- Complexity 3765 3778 +13
============================================
Files 301 301
Lines 14206 14206
Branches 1883 1883
============================================
+ Hits 11371 11419 +48
+ Misses 2092 2045 -47
+ Partials 743 742 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
||
extractedContext.makeCurrent().use { _ -> | ||
val otelSpan = givenSpanBuilder().startSpan() | ||
thenTraceIdIsUsed(otelSpan) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice helper methods 👍
|
||
@Test | ||
fun `does nothing on start if Sentry has not been initialized`() { | ||
val hub = mock<IHub>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s: Any reason why you're not using the fixture's hub here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure it's a clean mock that doesn't respond to anything but the wanted invocation on the hub. Rest is mocks that differ from other tests anyways. Guess it's also easier to read with the fresh mock instead of getting the one from the fixture that makes people read through all the setup code.
#skip-changelog
📜 Description
Add more tests for OpenTelemetry
SentrySpanProcessor
andSentryPropagator
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
🔮 Next steps