-
Notifications
You must be signed in to change notification settings - Fork 98
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 telemetry/test
package
#1194
Conversation
1143241
to
efe7c8d
Compare
This package is used to verify the encode/decode of the telemetry pkg is compliant with pdata (i.e. OTLP).
efe7c8d
to
71a4186
Compare
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.
How about adding TestJSONMarshalRoundtrip
test (to avoid bugs like this open-telemetry/opentelemetry-go#1273) which does something like the following:
func TestJSONMarshalRoundtrip(t *testing.T) {
data, err := json.Marshal(traces)
require.NoError(t, err)
var got telemetry.Traces
err := json.Unmarshal(data, &got)
require.NoError(t, err)
assert.Equal(t, traces, got)
}
It could added to tests in telemetry
package. However, adding it here is easier as we already have "testdata" in form or traces
field.
This comment can be addressed in a separate PR.
I'm looking at adding this in a separate PR presently. |
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.
👍
|
Co-authored-by: Robert Pająk <pellared@hotmail.com>
The collector issue blocking this was resolved.
This package is used to verify the encode/decode of the telemetry pkg is compliant with pdata (i.e. OTLP). It is added as a separate module to isolate the
pdata
dependencies fromtelemetry
which is explicitly designed to not include these dependencies.