Skip to content

Conversation

@andyb-elastic
Copy link
Contributor

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

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
@andyb-elastic andyb-elastic added >test Issues or PRs that are addressing/adding tests :Analytics/Geo Indexing, search aggregations of geo points and shapes v8.0.0 labels Mar 6, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (:Analytics/Geo)

assertTrue(AggregationInspectionHelper.hasValue(internalMissing));
});
},
List.of(fieldType, anotherFieldType));
Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #53250

@polyfractal polyfractal added :Analytics/Aggregations Aggregations and removed :Analytics/Geo Indexing, search aggregations of geo points and shapes labels Mar 6, 2020
Copy link
Contributor

@polyfractal polyfractal left a 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

@andyb-elastic
Copy link
Contributor Author

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
@andyb-elastic
Copy link
Contributor Author

@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

Copy link
Contributor

@polyfractal polyfractal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andyb-elastic andyb-elastic merged commit 4095df4 into elastic:master Mar 11, 2020
@andyb-elastic
Copy link
Contributor Author

Thanks!

andyb-elastic added a commit that referenced this pull request Apr 1, 2020
Tests for unmapped fields, the missing parameter, scripting, and correct
ValuesSource types in MissingAggregatorTests. Basic yaml tests for the
missing agg

For #42949
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations >test Issues or PRs that are addressing/adding tests v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants