-
Notifications
You must be signed in to change notification settings - Fork 25.6k
add tests for missing aggregation #53214
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 tests for missing aggregation #53214
Conversation
Test with unmapped fields and using the missing parameter, which isn't very useful with this aggregation but does work as expected. Also includes yaml tests For elastic#42949
|
Pinging @elastic/es-analytics-geo (:Analytics/Geo) |
| assertTrue(AggregationInspectionHelper.hasValue(internalMissing)); | ||
| }); | ||
| }, | ||
| List.of(fieldType, anotherFieldType)); |
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.
Note: in some of the aggregator tests similar to this one (where there's a second field we expect to be absent sometimes), we don't pass a field type for the second field like above. If the test is missing the second field type, that field can't be read even if an aggregator was erroneously trying to collect it
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.
We should fix that, could you open a ticket so we don't forget please?
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 opened #53250
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.
Test changes look good, thanks for beefing them up!
Let's also add in the new "supported type" tests. Here's a recently-merged example for terms agg: https://github.com/elastic/elasticsearch/blob/master/server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorTests.java#L127-L136
Missing agg supporting missing... I guess I'm not surprised but yeah, what a not-useful option. I wonder if we should deprecate that in the future....
Edit: Oh, let's add a test for scripting too, while we're at it? Here's an example from the Avg tests: https://github.com/elastic/elasticsearch/blob/master/server/src/test/java/org/elasticsearch/search/aggregations/metrics/AvgAggregatorTests.java#L341
|
Thanks, I'll add tests for scripting and supported types. For some reason I thought the supported types tests weren't being run in master yet |
Also change the test case pattern to be more flexible and more similar to how the other agg tests are written
|
@polyfractal added some scripting tests. Ended up changing the rest of the test cases to bring them more in line with the other agg tests and (I hope) make them a little more readable |
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!
|
Thanks! |
Tests for unmapped fields, the missing parameter, scripting, and correct ValuesSource types in MissingAggregatorTests. Basic yaml tests for the missing agg For #42949
Test with unmapped fields and using the missing parameter, which isn't
very useful with this aggregation but does work as expected. Also
includes yaml tests
For #42949