-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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 |
||
mrs.GetServices(context.Background()) | ||
mockReader.On("GetOperations", "something").Return([]string{}, nil) | ||
mockReader.On("GetOperations", context.Background(), "something").Return([]string{}, nil) | ||
mrs.GetOperations(context.Background(), "something") | ||
mockReader.On("GetTrace", model.TraceID{}).Return(&model.Trace{}, nil) | ||
mockReader.On("GetTrace", context.Background(), model.TraceID{}).Return(&model.Trace{}, nil) | ||
mrs.GetTrace(context.Background(), model.TraceID{}) | ||
mockReader.On("FindTraces", &spanstore.TraceQueryParameters{}).Return([]*model.Trace{}, nil) | ||
mockReader.On("FindTraces", context.Background(), &spanstore.TraceQueryParameters{}).Return([]*model.Trace{}, nil) | ||
mrs.FindTraces(context.Background(), &spanstore.TraceQueryParameters{}) | ||
counters, gauges := mf.Snapshot() | ||
expecteds := map[string]int64{ | ||
|
@@ -86,13 +86,13 @@ func TestFailingUnderlyingCalls(t *testing.T) { | |
|
||
mockReader := mocks.Reader{} | ||
mrs := NewReadMetricsDecorator(&mockReader, mf) | ||
mockReader.On("GetServices").Return(nil, errors.New("Failure")) | ||
mockReader.On("GetServices", context.Background()).Return(nil, errors.New("Failure")) | ||
mrs.GetServices(context.Background()) | ||
mockReader.On("GetOperations", "something").Return(nil, errors.New("Failure")) | ||
mockReader.On("GetOperations", context.Background(), "something").Return(nil, errors.New("Failure")) | ||
mrs.GetOperations(context.Background(), "something") | ||
mockReader.On("GetTrace", model.TraceID{}).Return(nil, errors.New("Failure")) | ||
mockReader.On("GetTrace", context.Background(), model.TraceID{}).Return(nil, errors.New("Failure")) | ||
mrs.GetTrace(context.Background(), model.TraceID{}) | ||
mockReader.On("FindTraces", &spanstore.TraceQueryParameters{}).Return(nil, errors.New("Failure")) | ||
mockReader.On("FindTraces", context.Background(), &spanstore.TraceQueryParameters{}).Return(nil, errors.New("Failure")) | ||
mrs.FindTraces(context.Background(), &spanstore.TraceQueryParameters{}) | ||
counters, gauges := mf.Snapshot() | ||
expecteds := map[string]int64{ | ||
|
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 becontext.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)