Migrate CardinalityIT test to AggregatorTestCase#80951
Merged
salvatore-campagna merged 20 commits intoelastic:masterfrom Dec 1, 2021
Merged
Conversation
|
💚 CLA has been signed |
Contributor
Author
|
@elasticmachine run CLA |
46 tasks
Replace integration tests with unit tests for cardinality aggregations. Unit tests are generally faster and easier to test against.
1cf48ab to
2c9d2f9
Compare
csoulios
reviewed
Nov 25, 2021
Contributor
csoulios
left a comment
There was a problem hiding this comment.
Very good first effort. Perhaps you should override the getSupportedValuesSourceTypes() method so that we test the matrix of supported/unsupported field types.
Also, I think that some aggregation tests from CardinalityIT have not been ported to CardinalityAggregatorTests (testAsSubAgg, testScriptCaching, testPartiallyUnmapped and the "value script" tests) (check MaxAggregatorTests on how to implement some of them)
.../src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregatorTests.java
Show resolved
Hide resolved
Overriding getSupportedValuesSourceTypes and createAggBuilderForTypeTest results in testing all the supported value types for the cardinality aggregator. The cardinality aggregator supports all core values types.
This test uses a terms aggregation as a top level aggregation and a cardinality aggregation as a sub-aggretation.
Contributor
Author
|
@elasticmachine run elasticsearch-ci/rest-compatibility |
csoulios
reviewed
Nov 30, 2021
Contributor
csoulios
left a comment
There was a problem hiding this comment.
Add couple more comments.
.../src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregatorTests.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregatorTests.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregatorTests.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregatorTests.java
Outdated
Show resolved
Hide resolved
nik9000
reviewed
Nov 30, 2021
.../src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregatorTests.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregatorTests.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@elasticmachine update branch |
Contributor
Author
|
@elasticmachine update branch |
Contributor
|
Congrats on your first PR getting merged! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace integration tests with unit tests for cardinality aggregations.
Unit tests are generally faster and easier to test against.
This is part of the transition from integration to unit tests described by #42893