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

Remove unnecessary proto marshaler tests, avoid using InternalRep in otlprecv #3386

Merged
merged 1 commit into from
Jun 12, 2021

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Jun 8, 2021

Updates #3104

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

@bogdandrutu bogdandrutu requested review from a team and owais June 8, 2021 12:58
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

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

Blocking since unclear why the tests are deleted.

Comment on lines -246 to -258
func TestJsonMarshaling(t *testing.T) {
m := jsonpb.Marshaler{}
json, err := m.MarshalToString(&resourceSpansOtlp)
assert.NoError(t, err)

var resourceSpansOtlp2 otlptrace.ResourceSpans
err = jsonpb.UnmarshalString(json, &resourceSpansOtlp2)
assert.NoError(t, err)

assert.EqualValues(t, resourceSpansOtlp, resourceSpansOtlp2)
}

func TestJsonUnmarshaling(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

These are important tests that verify JSON marshaling. Why delete these?

Copy link
Member Author

@bogdandrutu bogdandrutu Jun 9, 2021

Choose a reason for hiding this comment

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

We are testing that the jsonpb (from a third-party library) does the right thing. Unit-tests should be for our code and we should not write unit-tests to test third-party libraries unless a specific bug is covered.

Copy link
Member Author

Choose a reason for hiding this comment

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

Friendly ping @tigrannajaryan

@bogdandrutu bogdandrutu merged commit 3050c8e into open-telemetry:main Jun 12, 2021
@bogdandrutu bogdandrutu deleted the cleanotlprecv branch June 12, 2021 07:52
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