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 a test that checks if reports with data round-trip #2399

Merged
merged 1 commit into from
Feb 26, 2018
Merged

Conversation

bboreham
Copy link
Collaborator

Previously the only roundtrip test was for an empty report. This test has fake data similar to that found in real reports.

Node.Metrics does not round-trip exactly: it is tagged with omitempty so when decoded an empty map turns into the zero value. A DeepEqual workaround is added so the test passes.
Perhaps it would be better to adjust the decode so the field is not nil after decoding.

This PR is a precursor to tests which check backwards compatibility: for instance that the binary data encoded by version 1.2 still decodes to the expected structure.

@2opremio
Copy link
Contributor

@bboreham Mind fixing the linting error?

@bboreham
Copy link
Collaborator Author

bboreham commented Apr 1, 2017

I re-did the DeepEqual thing with a tag, seems neater.

@2opremio
Copy link
Contributor

2opremio commented Apr 4, 2017

@bboreham Mind fixing the linter errors?

@rade
Copy link
Member

rade commented Jul 19, 2017

@bboreham IIRC you felt that the DeepEqual thing still is rather much of a hack.

I don't really want this PR to sit around here forever. So please make a call whether to proceed or close.

@bboreham
Copy link
Collaborator Author

No, I didn't say that. Have rebased and removed the "tests which check backwards compatibility: for instance that the binary data encoded by version 1.2 still decodes to the expected structure", which was too ugly.

@rade rade requested a review from 2opremio July 20, 2017 12:40
@bboreham bboreham mentioned this pull request Sep 30, 2017
Previously the only roundtrip test was for an empty report.
This test has fake data similar to that found in real reports.
'Metrics' does not round-trip exactly, so a DeepEqual workaround is
added for that.
@bboreham
Copy link
Collaborator Author

I would like this test to be added. Have rebased on latest master.

@rade rade merged commit c9d9068 into master Feb 26, 2018
@bboreham bboreham deleted the big-roundtrip branch September 13, 2019 15:34
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