-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Test that rank_eval request parsing is not lenient #28516
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 that rank_eval request parsing is not lenient #28516
Conversation
The parsing of the ranking evaluation request and its subcomponents should detect unknown fields and throw parsing errors. This currently isn't testing so this change adds those tests and changes the parser behaviour in cases where it is needed.
7446959 to
93c56c5
Compare
javanna
left a comment
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.
left a question, LGTM otherwise
| } | ||
| } | ||
|
|
||
| public void testXContentParsingNotLenient() throws IOException { |
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.
is this testing that parsing is or is not lenient? I can't get that from the name ;) Is this part of a request or response?
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.
This is testing that adding random fields somewhere in the xContent throws an error. So its testing that parsing is not lenient. All these are part of the request, so I think thats the behaviour we want there, whereas we want to be lenient on the response side. I can rename all these test methods to e.g. testRequestParsingIsNotLenient, maybe add a short comment as well. Would that be better?
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.
Adding the is verb is good enough on my end, thanks.
|
@javanna thanks for the review, I pushed an update and will merge once CI is green |
Parsing of a ranking evaluation request and its subcomponents should throw parsing errors on unknown fields. This change adds tests for this and changes the parser behaviour in cases where it is needed.
The parsing of the ranking evaluation request and its subcomponents should
detect unknown fields and throw parsing errors. This currently isn't testing so
this change adds those tests and changes the parser behaviour in cases where it
is needed.