Skip to content
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

Merged
merged 2 commits into from
Dec 13, 2018
Merged

Conversation

vprithvi
Copy link
Contributor

See #1241

  • Currently only implemented for C*
  • Update the reader mock and pass through context everywhere

Signed-off-by: Prithvi Raj p.r@uber.com

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")).
Copy link
Member

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?

Copy link
Contributor Author

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)
Copy link
Member

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?

Copy link
Contributor Author

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
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

Merging #1246 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1246   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files         159     159           
  Lines        7145    7163   +18     
======================================
+ Hits         7145    7163   +18
Impacted Files Coverage Δ
plugin/storage/memory/memory.go 100% <100%> (ø) ⬆️
plugin/storage/cassandra/spanstore/reader.go 100% <100%> (ø) ⬆️
plugin/storage/es/spanstore/reader.go 100% <100%> (ø) ⬆️
storage/spanstore/metrics/decorator.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f6af99...5054e0b. Read the comment docs.

Signed-off-by: Prithvi Raj <p.r@uber.com>
@vprithvi vprithvi force-pushed the update-reader-interface branch from c29b2f7 to 5054e0b Compare December 13, 2018 16:17
@vprithvi vprithvi merged commit 2df4cd0 into master Dec 13, 2018
@ghost ghost removed the review label Dec 13, 2018
@vprithvi vprithvi deleted the update-reader-interface branch December 13, 2018 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants