-
Notifications
You must be signed in to change notification settings - Fork 28
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
json: test: Add 'stability' JSON test #103
Conversation
We don't want the JSON serialization of pkg/config/ data structures to change between releases. This commit makes use of the `reflect` package to test the JSON serialization of as many fields as possible. If one of these field change, the test will make us aware of it. We still need to explicitly list the types to be tested (ie the types which can be serialized to JSON). Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
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.
Code LGTM.
The only concern I have is that if we add new devices in the future, we need to make sure to add corresponding test cases in jsonStabilityTests
. There is a possibility that we might forget to do so.
@BlackHole1: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Yes, hopefully this won't happen too often. I've tried to find a programmatic way of listing all the types defined in |
It seems a bit complicated, we can consider putting it on hold for now and reevaluate if we encounter this issue in the future. |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BlackHole1, cfergeau, praveenkumar The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
We don't want the JSON serialization of pkg/config/ data structures to
change between releases.
This commit makes use of the
reflect
package to test the JSON serializationof as many fields as possible. If one of these field change, the test
will make us aware of it.
We still need to explicitly list the types to be tested (ie the types
which can be serialized to JSON).