-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Clean up some aggregation tests #66044
Conversation
This rewrites two tests for aggregations to use `AggregatorTestCase`'s simpler way of making `Aggregator`s, allowing us to remove a ctor on `ProductionAggregationContext` that we weren't happy about. Now there is only a single test call to `ProductionAggregationContext` and we can remove that soon.
Pinging @elastic/es-analytics-geo (Team:Analytics) |
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. Left a nit about test naming, but it's a matter of taste.
|
||
public class AggregationCollectorTests extends ESSingleNodeTestCase { | ||
public class AggregationCollectorTests extends AggregatorTestCase { |
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.
Oh, hey, moving this off of ESSingleNodeTestCase
is a win!
IndexService index = createIndex("idx"); | ||
client().prepareIndex("idx").setId("1").setSource("f", 5).execute().get(); | ||
client().admin().indices().prepareRefresh("idx").get(); | ||
public void testSubScriptDoesntNeedScoresIfSubScriptDoesntNeedScores() 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.
I am not a fan of this method of documenting tests. CamelCase sentences are hard to read, and with many similar names it's easy to miss the differences between two of them. Maybe just name this something like testSubScriptNoScore
and add a javadoc noting what it's intended to test? Same for the other very long test names.
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 like having a test for each thing. I could go either way on the long names. I'll change them.
This rewrites two tests for aggregations to use `AggregatorTestCase`'s simpler way of making `Aggregator`s, allowing us to remove a ctor on `ProductionAggregationContext` that we weren't happy about. Now there is only a single test call to `ProductionAggregationContext` and we can remove that soon.
This rewrites two tests for aggregations to use `AggregatorTestCase`'s simpler way of making `Aggregator`s, allowing us to remove a ctor on `ProductionAggregationContext` that we weren't happy about. Now there is only a single test call to `ProductionAggregationContext` and we can remove that soon.
This rewrites two tests for aggregations to use
AggregatorTestCase
'ssimpler way of making
Aggregator
s, allowing us to remove a ctor onProductionAggregationContext
that we weren't happy about. Now there isonly a single test call to
ProductionAggregationContext
and we canremove that soon.