-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Rest test fixes #27354
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
Rest test fixes #27354
Conversation
|
Thanks for looking into that, @clintongormley! I've run the Ruby test suite against the patch and I'm getting more failures than on current master :), I'll investigate more in the next couple of days. |
| "95.0": 143.49999999999997 | ||
| "99.0": 149.5 | ||
|
|
||
| # - match: |
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.
The fixes made by @fxdgear in #26905, and my subsequent fixes in #27355 worked nicely for me in Ruby. I must admit I like more the original notation. Also, some tests in the proposed notation (aggregations.percentiles_int.values.5\.0) fail for me, not sure how the Ruby runner handles it, must debug...
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.
The test runners are supposed to support dots escaped with \.
The original notation is a non-starter for me, for instance Perl gets back 143.5 and keeps it as that value, rather than converting to 143.49999999999997. But then it sees 1.0 in the response and reads that as 1(then the test fails when it tries to compare it to 1.0).
I can do numeric comparisons when there is a single numeric-like value on the right, but not with an object.
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.
What I could do (keeping the key-to-numeric-value format) is allow for approximate numeric matching (ie within a certain tolerance) so that I can remove the lte/gte
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.
I'm thinking we may just want to remove the values like 143.49999999999997. I didn't think about it at the time when I added the test, but these are likely subject to how each language interprets json floats and internal float vs double, etc.
Would simplify everyone's life if we stuck to nice "discrete" floats (149.5, etc). The point of these REST tests are to just do rough validation of the body, not really the values, so I think it's fine if we omit the problematic percentiles.
Mpdreamz
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.
Other than a small nitpick LGTM
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "render_search_template": { | |||
| "indices.render_search_template": { | |||
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.
But nit picky perhaps but I think this actually makes more sense unnamespaced like other search related API's. Do not feel strongly about this though.
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.
Thanks, you're right - don't know what i was thinking
| - do: | ||
| catch: /Malformed action\/metadata line \[3\], expected FIELD_NAME but found \[END_OBJECT\]/ | ||
| headers: | ||
| Content-Type: application/json |
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.
why did you remove these? I'm afraid they were there for a reason. This may work for clients without the header as they always use json content-type anyway, but providing the header disables the content-type randomization that the java yaml test runner usually does.
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.
OK - I can revert this and add a features skip clause instead. The problem was that it had headers, but hadn't declared the need for the headers feature.
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.
Ah, I see that the headers feature has already been added, but it's impossible to ignore without also adding parsing to skip it... which i shall duly do (and revert this change)
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.
you mean that you would expect two skip clauses here? or the reason also highlighting why the headers skip?
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.
ok sorry we were kind of typing at the same time, ignore my last message ;)
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.
I think I've fixed this in #26896, but I might have forgot to cherry-pick that commit into the 6.0 branch, which I did yesterday.
| "Test Grok Patterns Retrieval": | ||
| - do: | ||
| ingest.processor.grok: {} | ||
| ingest.processor_grok: {} |
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.
wondering if you were the first one ever running these tests...
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.
I think I don't follow this change, why the underscore instead of the dot? the API is called ingest.processor.grok in the spec right? This should fail the build I think.
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.
I renamed ingest.processor.grok to ingest.processor_grok in the spec too, so this should work. The reason for the underscore instead of the dot is that an underscore returns a new namespace in the REST clients, but we have only one thing in this namespace, so makes more sense just to have it at the same level as the other ingest methods.
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.
Yes, I see that now. And the name of the api didn't match the name of the file. All good. I am going to open a PR to validate that the name of the api matches the filename, I've seen enough of these errors.
|
jenkins test this |
8a7664c to
5c0c2a8
Compare
* REST: Rename ingest.processor.grok to ingest.processor_grok * REST: Rename remote.info to cluster.remote_info * REST: Fixed bad YAML comments * REST: Force dummy scripts to be strings, not numbers * REST: Fix bad YAML in search/110_field_collapsing.yml * REST: Adjust percentile tests to work with Perl number handling
* REST: Rename ingest.processor.grok to ingest.processor_grok * REST: Rename remote.info to cluster.remote_info * REST: Fixed bad YAML comments * REST: Force dummy scripts to be strings, not numbers * REST: Fix bad YAML in search/110_field_collapsing.yml * REST: Adjust percentile tests to work with Perl number handling
* es/master: Logging: Unify log rotation for index/search slow log (#27298) wildcard query on _index (#27334) REST spec: Validate that api name matches file name that contains it (#27366) Revert "Reduce synchronization on field data cache" Create new handlers for every new request in GoogleCloudStorageService (#27339) Rest test fixes (#27354)
* es/6.x: Updated 6.0.0 release notes to include all changes from alpha, beta, RC wildcard query on _index (#27334) REST spec: Validate that api name matches file name that contains it (#27366) Revert "Reduce synchronization on field data cache" Create new handlers for every new request in GoogleCloudStorageService (#27339) Rest test fixes (#27354)
These are various fixes I had to make to get Perl running with the rest tests.