Skip to content

Commit

Permalink
jaegertracing#2048[WIP] - Fix fmt issues
Browse files Browse the repository at this point in the history
Signed-off-by: santosh <bsantosh@thoughtworks.com>
  • Loading branch information
bhiravabhatla committed Jan 25, 2021
1 parent 76256d6 commit 1a888aa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 2 additions & 0 deletions cmd/opentelemetry/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,10 @@ github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv
github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5/go.mod h1:ppEjwdhyy7Y31EnHRDm1JkChoC7LXIJ7Ex0VYLWtZtQ=
github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM=
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0=
github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
Expand Down
6 changes: 3 additions & 3 deletions pkg/es/textTemplate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestParse(t *testing.T) {

}

func TestNewTextTemplateBuilder(t *testing.T){
func TestNewTextTemplateBuilder(t *testing.T) {
textBuilder := NewTextTemplateBuilder()
assert.IsType(t, TextTemplateBuilder{},textBuilder)
}
assert.IsType(t, TextTemplateBuilder{}, textBuilder)
}
21 changes: 11 additions & 10 deletions plugin/storage/es/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type mockClientBuilder struct {
err error
createTemplateError error
}

var mockTextTemplateBuilder = func() es.TemplateBuilder {
tb := mocks.TemplateBuilder{}
ta := mocks.TemplateApplier{}
Expand Down Expand Up @@ -105,7 +106,7 @@ func TestElasticsearchFactory(t *testing.T) {

newTextTemplateBuilder = mockTextTemplateBuilder
_, err = f.CreateSpanWriter()
assert.EqualError(t,err,"template load error")
assert.EqualError(t, err, "template load error")

assert.NoError(t, f.Close())
}
Expand Down Expand Up @@ -360,7 +361,7 @@ func TestGetSpanServiceMappings(t *testing.T) {
tb.On("Parse", mock.Anything).Return(&ta, nil)
return &tb
},
err: "",
err: "",
},
{
name: "ES Version 7 Error",
Expand All @@ -378,7 +379,7 @@ func TestGetSpanServiceMappings(t *testing.T) {
tb.On("Parse", mock.Anything).Return(&ta, nil)
return &tb
},
err: "template load error",
err: "template load error",
},

{
Expand All @@ -397,7 +398,7 @@ func TestGetSpanServiceMappings(t *testing.T) {
tb.On("Parse", mock.Anything).Return(&ta, nil)
return &tb
},
err: "",
err: "",
},
{
name: "ES Version < 7 Error",
Expand All @@ -415,7 +416,7 @@ func TestGetSpanServiceMappings(t *testing.T) {
tb.On("Parse", mock.Anything).Return(&ta, nil)
return &tb
},
err: "template load error",
err: "template load error",
},
}
for _, test := range tests {
Expand All @@ -439,15 +440,15 @@ func TestGetSpanServiceMappings(t *testing.T) {
}
}

func TestGetDependenciesMappings(t *testing.T){
func TestGetDependenciesMappings(t *testing.T) {
oldTextTemplateBuilder := newTextTemplateBuilder
defer func() {
newTextTemplateBuilder = oldTextTemplateBuilder
}()

newTextTemplateBuilder = mockTextTemplateBuilder
_,err := GetDependenciesMappings(5,5,7)
assert.EqualError(t, err,"template load error")
_, err := GetDependenciesMappings(5, 5, 7)
assert.EqualError(t, err, "template load error")
_, err = GetDependenciesMappings(5, 5, 6)
assert.EqualError(t, err,"template load error")
}
assert.EqualError(t, err, "template load error")
}

0 comments on commit 1a888aa

Please sign in to comment.