-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
test: simply the expected output for some curl test cases #16572
Conversation
This PR lowers quality of testing by skipping testing some fields, which we are no longer able to cover using a naive "find matching line" validation. Could we just use json parsing for JSON API? For example create something like EtcdctlV3 that has spawnJsonCommand to parse JSON responses. As we add more tests, the more complicated they are, and the more abstraction leak we get. Abstraction leak happens when abstractions you created doesn't correctly reflect the modeled problem. Like in those tests, we are using "find matching line" logic to analyse JSON responses, it doesn't work as JSON can have arbitrary whitespaces injected. Until we fix our abstraction we will continue to need to patch our tests like in this PR. |
Signed-off-by: Benjamin Wang <wachao@vmware.com>
feecb29
to
d687bd0
Compare
|
Pls do not make it big on this PR. If you have any additional thoughts, please raise a separate ticket to discuss; and anyone is welcome to refactor or improve existing test cases. |
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.
Agree it would be best to more formally parse the json responses.
With that said, provided we have a follow-up issue created to track the work I am comfortable for it to be addressed at a later date.
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.
LGTM
thx all for the review! |
Link to #16454
Random spaces may be inserted between fields in a marshalled json response in grpc-gateway v2, so simply the expected output to make it work for both v1 and v2.