-
Notifications
You must be signed in to change notification settings - Fork 6
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
Datadog::CI.trace_test always starts a new trace #74
Conversation
…n a session they belong to a single trace
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #74 +/- ##
==========================================
+ Coverage 99.30% 99.32% +0.02%
==========================================
Files 125 125
Lines 4328 4328
Branches 153 153
==========================================
+ Hits 4298 4299 +1
+ Misses 30 29 -1 ☔ View full report in Codecov by Sentry. |
@@ -119,6 +122,11 @@ def trace | |||
end | |||
end | |||
|
|||
# returns trace associated with given span | |||
def trace_for_span(span) | |||
traces.find { |trace| trace.id == span.trace_id } |
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 double-check: traces
contains only currently active traces, right? Asking because of the linear search.
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.
this one is a spec helper so it is used only in tests to examine the tracer's internal state for our assertions
we never access tracer's state in production like that
3ecfd8d
to
a14f853
Compare
What does this PR do?
Makes sure that when tracing a test we always create a new trace by using
continue_from
span optionMotivation
In order not to break trace view UI we need to be sure that each test receives its own trace
Additional Notes
Unrelated change:
Datadog::CI::Recorder
spec is completely rewritten in saner style without endless doubles and expectactionsHow to test the change?
Unit tests are provided