-
Notifications
You must be signed in to change notification settings - Fork 4
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
Manual test tracing API #61
Conversation
Codecov Report
@@ Coverage Diff @@
## main #61 +/- ##
==========================================
+ Coverage 99.15% 99.17% +0.01%
==========================================
Files 103 106 +3
Lines 3533 3616 +83
Branches 134 131 -3
==========================================
+ Hits 3503 3586 +83
Misses 30 30
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
) | ||
|
||
Thread.current[:_datadog_test_span] = span | ||
Thread.current[:_datadog_test_span] = test_span |
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.
A bit of an unrelated comment, but this before_setup
method cannot be nested with itself right? I ask because setting Thread.current[:_datadog_test_span] = test_span
twice before calling the respective after_teardown
in the correct order will cause issues.
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.
good point, I will check that - should not be the case, I have a bunch of minitest projects for integration testing, did not encounter lost test traces
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.
anyway this is something to replace with Datadog::CI::Context
in the subsequent PR
What does this PR do?
This PR refactors
Datadog::CI
internals and provides a public API for manual test instrumentation viaDatadog::CI
module.How to use the new API:
There is also a convenience method
CI.start_test
that does not accept a block:These methods return or yield new
Datadog::CI::Span
object that represents tracing span in CI context adding some domain-specific behaviour (like a possibility to set status withpassed!
,skipped!
, andfailed!
methods)Next steps (in subsequent PRs)
Datadog::CI::ContextProvider
module to storeactive_test
spanHow to test the change?
No behaviour change, unit&integration tests make sure that it still works