Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Pass options along when creating a span with StartSpanFromContext #114

Merged
merged 3 commits into from Sep 23, 2016
Merged

Pass options along when creating a span with StartSpanFromContext #114

merged 3 commits into from Sep 23, 2016

Conversation

gwik
Copy link
Contributor

@gwik gwik commented Sep 22, 2016

Options were ignored when creating a span.

@yurishkuro
Copy link
Member

Do you mind adding unit tests?

@gwik
Copy link
Contributor Author

gwik commented Sep 22, 2016

here you go.

@@ -21,6 +21,7 @@ func nextFakeID() int {
type testSpanContext struct {
HasParent bool
FakeID int
Options *StartSpanOptions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have a slight preference to just add tags to testSpan and test that they get passed through correctly... if you don't feel like implementing this, I can do it :)

@@ -28,6 +29,35 @@ func (n testSpanContext) ForeachBaggageItem(handler func(k, v string) bool) {}
type testSpan struct {
spanContext testSpanContext
OperationName string
StartTime time.Time
Tags map[string]interface{}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct equality won't work with a map member, so I implemented an Equal method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe adding an id and compare it would make more sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@bhs
Copy link
Contributor

bhs commented Sep 22, 2016

Thanks @gwik... the test LGTM but I will give @yurishkuro a chance to provide feedback if he so desires...

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix lint errors

testtracer_test.go:64:1: receiver name n should be consistent with previous receiver name s for testSpan

@yurishkuro yurishkuro merged commit 449a42d into opentracing:master Sep 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants