-
Notifications
You must be signed in to change notification settings - Fork 19
Test-utils to visualize spans #235
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
Conversation
tracing/src/test/java/com/palantir/tracing/HtmlSpanObserver.java
Outdated
Show resolved
Hide resolved
|
I've tried this on c-j-r which is a bit weird because many tests don't actually neatly close a trace. I think it gives reasonable output. |
94c775c to
508a077
Compare
…into dfox/render-spans
3134b85 to
dd7fba6
Compare
…into dfox/render-spans
2fd0737 to
0963fd4
Compare
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| final class TestTracingExtension implements BeforeEachCallback, AfterEachCallback { |
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.
why BeforeEachCallback rather than BeforeTestExecution?
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.
It seems like BeforeTestExecution was causing the spans within the setup method to also be captured
Before this PR
I sometimes find it hard to intuitively imagine what spans look like, especially when we're talking about async stuff. We also don't have a good way of testing spans in our libraries (e.g. conjure-java-runtime).
After this PR
==COMMIT_MSG==
Tests can now be annotated
@TestTracingto set up snapshot testing.==COMMIT_MSG==
Possible downsides / known limitations
Tracer.setSamplerpart way through the tests (which WC does), they'll get incomplete info in the tests