-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add FindTraceID
to the spanstore interface
#1246
Conversation
Signed-off-by: Prithvi Raj <p.r@uber.com>
@@ -29,13 +29,13 @@ import ( | |||
|
|||
func TestGetArchivedTrace_NotFound(t *testing.T) { | |||
mockReader := &spanstoremocks.Reader{} | |||
mockReader.On("GetTrace", mock.AnythingOfType("model.TraceID")). | |||
mockReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). |
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.
What is context.valueCtx
? Shouldn't it be context.Context
?
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's an implementation of context.Context
, I used the implementation because mock.AnythingOfType doesn't appear to work with interfaces. (See stretchr/testify#519)
@@ -33,13 +33,13 @@ func TestSuccessfulUnderlyingCalls(t *testing.T) { | |||
|
|||
mockReader := mocks.Reader{} | |||
mrs := NewReadMetricsDecorator(&mockReader, mf) | |||
mockReader.On("GetServices").Return([]string{}, nil) | |||
mockReader.On("GetServices", context.Background()).Return([]string{}, nil) |
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.
how did this ever work before?
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.
My hypothesis is that the field is ret reflectively and the prior absence of this field in both the On
invocation and the generated code failed silently. (I don't understand how the mock could satisfy the reader interface though.)
Codecov Report
@@ Coverage Diff @@
## master #1246 +/- ##
======================================
Coverage 100% 100%
======================================
Files 159 159
Lines 7145 7163 +18
======================================
+ Hits 7145 7163 +18
Continue to review full report at Codecov.
|
Signed-off-by: Prithvi Raj <p.r@uber.com>
c29b2f7
to
5054e0b
Compare
See #1241
Signed-off-by: Prithvi Raj p.r@uber.com