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 tests for OTLP JSON encode/decode #3400

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

bogdandrutu
Copy link
Member

Signed-off-by: Bogdan Drutu [email protected]

@bogdandrutu bogdandrutu requested review from a team and dmitryax June 9, 2021 09:14
Comment on lines +37 to +38
err := d.delegate.Unmarshal(bytes.NewReader(buf), ld)
return ld, err
Copy link
Member

Choose a reason for hiding this comment

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

This is not totally equivalent to the old code but I guess it is fine to return non-nil with an error. Should this behavior be documented in the DecodeLogs interface definition?

},
}

var tracesJSON = `{"resourceSpans":[{"resource":{"attributes":[{"key":"host.name","value":{"stringValue":"testHost"}}]},"instrumentationLibrarySpans":[{"instrumentationLibrary":{"name":"name","version":"version"},"spans":[{"traceId":"","spanId":"","parentSpanId":"","name":"testSpan","status":{}}]}]}]}`
Copy link
Member

Choose a reason for hiding this comment

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

Ahh, pity it has to be a single line. We cannot use pretty-printed version here?

@bogdandrutu bogdandrutu merged commit 0d74747 into open-telemetry:main Jun 11, 2021
@bogdandrutu bogdandrutu deleted the otlptests branch June 11, 2021 09:06
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.

3 participants