-
Notifications
You must be signed in to change notification settings - Fork 352
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
tracing/tracingtest: deprecate Tracer and Span types #3375
tracing/tracingtest: deprecate Tracer and Span types #3375
Conversation
if len(tracer.RecordedSpans) == 0 { | ||
t.Fatal("no span recorded...") | ||
} | ||
if tracer.RecordedSpans[0].Trace != traceContent { | ||
t.Errorf("trace not found, got `%s` instead", tracer.RecordedSpans[0].Trace) | ||
} | ||
if len(tracer.RecordedSpans[0].Refs) == 0 { | ||
t.Errorf("no references found, this is a root 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.
This tested tracer internals and not HTTP propagator or something.
f459e69
to
bc966f4
Compare
bc966f4
to
e9c9be7
Compare
|
||
testCases := []struct { | ||
name string | ||
req *http.Request | ||
tracer opentracing.Tracer | ||
parentSpan opentracing.Span | ||
parentSpan string |
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 change is because closing parent span created during test case setup after tracer.Reset() is wrong and does not work properly with MockTracer.
e9c9be7
to
d86c1c8
Compare
Follow up on #684 (#684 (comment)) and deprecate hand-rolled test tracer implementation in favour of MockTracer added by #3322 that wraps github.com/opentracing/opentracing-go/mocktracer and waits for finished spans. Fix MockTracer: * return MockSpan that has proper Tracer() implementation * return MockSpan wrappers from FinishedSpans * panic on timeout waiting for finished spans Closes #2084 Updates #2104 Signed-off-by: Alexander Yastrebov <[email protected]>
d86c1c8
to
331f035
Compare
👍 |
1 similar comment
👍 |
Follow up on #684 (#684 (comment)) and
deprecate hand-rolled test tracer implementation in favour of
MockTracer added by #3322 that wraps github.com/opentracing/opentracing-go/mocktracer and waits for finished spans.
Fix MockTracer:
Closes #2084
Updates #2104