-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Today there is very little unit test coverage for bucket and metric aggregations. This meta issue aim is to significantly improve that. For each aggregation we should add more unit tests for the aggregator (how it interacts with the Lucene index via org.apache.lucene.search.Collector that each aggregation implements), the reduce logic and serialization of the aggregation results.
We should add unit tests for the following Aggregator implementations:
-
ParentToChildrenAggregator@cbuescher Add unit tests for ParentToChildAggregator #23305 -
FilterAggregator@colings86 Adds tests for cardinality and filter aggregations #23826 -
FiltersAggregator@jimczi Add unit tests for FiltersAggregator #22678 -
GeoHashGridAggregator@martijnvg [TEST] Add unit tests for GeoHashGridAggregator and InternalGeoHashGrid #23417 -
GlobalAggregator@nik9000 Improve unit test coverage of aggs #22668 -
DateHistogramAggregator@tlrx Add unit tests for DateHistogramAggregator #22714 -
HistogramAggregator@jpountz Add unit tests to histogram aggregations. #22961 -
MissingAggregator@jimczi Add unit tests for the missing aggregator #23895 -
NestedAggregator@polyfractal -
ReverseNestedAggregator@cbuescher -
RangeAggregator(also test withDateRangeAggregationBuilderandGeoDistanceAggregationBuilder) @tlrx [Test] Add unit tests for Range aggregations #24569 -
BinaryRangeAggregator(also test withIpRangeAggregationBuilder) @jimczi Add unit tests for BinaryRangeAggregator/InternalBinaryRange #23255 - Diversified sampler aggregator, which has the following implementations that need to be tested:
DiversifiedBytesHashSamplerAggregator,DiversifiedMapSamplerAggregator,DiversifiedNumericSamplerAggregatorandDiversifiedOrdinalsSamplerAggregator. @martijnvg Added unit tests for diversified sampler aggregator #23511 -
SamplerAggregator@nik9000 Adds unit test for sampler aggregation #23243 - Significant terms aggregation:
GlobalOrdinalsSignificantTermsAggregator,GlobalOrdinalsSignificantTermsAggregator.WithHash,SignificantLongTermsAggregatorandSignificantStringTermsAggregator. @markharwood Added unit test coverage for SignificantTerms #24904 - Terms aggregation:
DoubleTermsAggregator,GlobalOrdinalsStringTermsAggregator. LowCardinality,GlobalOrdinalsStringTermsAggregator. WithHash,LongTermsAggregatorandStringTermsAggregator. @martijnvg Add more unit tests for terms aggregation #24949 -
BestBucketsDeferringCollector@MaineC Added unit tests for diversified sampler aggregator #23511 -
BestDocsDeferringCollector@polyfractal Added unit tests for diversified sampler aggregator #23511 -
AvgAggregator@cbuescher [Tests] Adding tests for AvgAggregator and InternalAvg #23000 -
CardinalityAggregator@colings86 Adds tests for cardinality and filter aggregations #23826 -
GeoBoundsAggregator@jimczi Add unit tests for GeoBoundsAggregator/InternalGeoBounds #23259 -
GeoCentroidAggregator@martijnvg Added unit test for GeoCentroidAggregator #24111 -
MaxAggregator@nik9000 Improve unit test coverage of aggs #22668 -
MinAggregator[MvG] Add base class for writing unit test for aggregations #22279 - Percentiles metric aggregation:
TDigestPercentilesAggregatorandHDRPercentilesAggregator@tlrx [Test] Add unit tests for HDR/TDigest PercentilesAggregators #24245 - Percentiles rank metric aggregation:
TDigestPercentileRanksAggregatorandHDRPercentileRanksAggregator. @jpountz Add unit tests to percentile ranks aggregations. #23240 -
ScriptedMetricAggregator@cbuescher Tests: Add unit test for InternalScriptedMetricAggregator #23404 -
StatsAggregator@jimczi -
ExtendedStatsAggregator@jimczi -
SumAggregator@martijnvg [TEST] Added unit tests for sum aggs. #22954 -
TopHitsAggregator@nik9000 Add more tests for top_hits aggregation #22754 -
ValueCountAggregator@tlrx [TEST] Add unit tests for ValueCountAggregator and InternalValueCount #22741 -
MatrixStatsAggregator@martijnvg Add unit tests for MatrixStatsAggregator #24837
We should also add tests for the following InternalAggregation implementations:
(to test the reduce and result serialization logic)
-
InternalChildren@cbuescher Tests: Add unit test for InternalChildren #23261 -
InternalFilter@colings86 Tests InternalSingleBucketAggregation subclasses #23388 -
InternalFilters@jimczi Add unit tests for FiltersAggregator #22678 -
InternalGeoHashGrid@martijnvg [TEST] Add unit tests for GeoHashGridAggregator and InternalGeoHashGrid #23417 -
InternalGlobal@nik9000 Tests InternalSingleBucketAggregation subclasses #23388 -
InternalHistogram@jpountz Add unit tests to histogram aggregations. #22961 -
InternalDateHistogram@tlrx Tests: Add unit test for InternalDateHistogram #23402 -
InternalMissing@MaineC Tests InternalSingleBucketAggregation subclasses #23388 -
InternalNested@polyfractal Tests InternalSingleBucketAggregation subclasses #23388 -
InternalReverseNested@cbuescher Tests InternalSingleBucketAggregation subclasses #23388 -
InternalRange,InternalDateRange,InternalGeoDistance. @tlrx [Test] Add unit tests for Range aggregations #24569 -
InternalBinaryRange@jimczi Add unit tests for GeoBoundsAggregator/InternalGeoBounds #23259 -
InternalSampler@martijnvg edada25 - Significant terms aggregation:
SignificantLongTermsandSignificantStringTerms. @tlrx Tests: Add unit test for SignificantLongTerms and SignificantStringTerms #23428 - Terms aggregation:
DoubleTerms,LongTerms,StringTermsandUnmappedTerms. @jpountz Add unit tests for terms aggregation objects. #23149 -
InternalAvg@cbuescher [Tests] Adding tests for AvgAggregator and InternalAvg #23000 -
InternalCardinality@colings86 Adds tests for cardinality and filter aggregations #23826 -
InternalGeoBounds@jimczi Add unit tests for GeoBoundsAggregator/InternalGeoBounds #23259 -
InternalGeoCentroid@martijnvg Added unittests for InternalGeoCentroid #24176 -
InternalMax@nik9000 Improve unit test coverage of aggs #22668 -
InternalMin@colings86 + @nik9000 Improve unit test coverage of aggs #22668 - Percentiles metric aggregation:
InternalTDigestPercentiles([Test] Add unit tests for InternalTDigestPercentilesTests #24090) andInternalHDRPercentiles([Test] Add unit tests for InternalHDRPercentilesTests #24157) @tlrx - Percentiles rank metric aggregation:
InternalTDigestPercentileRanksandInternalHDRPercentileRanks. @jpountz Add unit tests to percentile ranks aggregations. #23240 -
InternalScriptedMetric@cbuescher Tests: Add unit test for InternalScriptedMetric #23330 -
InternalStats@jimczi -
InternalExtendedStats@jimczi -
InternalSum@martijnvg [TEST] Added unit tests for sum aggs. #22954 -
InternalTopHits@nik9000 -
InternalValueCount@tlrx [TEST] Add unit tests for ValueCountAggregator and InternalValueCount #22741 -
InternalMatrixStats@martijnvg Added unit tests for InternalMatrixStats #24559
I may have forgotten some classes, so please update this issue if that is the case :)
I listed the InternalAggregation implementations separately from Aggregator implementations as unit tests for each can be written in parallel by different devs. However I think for the less complex aggregations unit tests for both the InternalAggregation implementation and Aggregator implementations can be added in the same PR.
I think at least the unit tests should be added to the master branch. Backporting to 5.x branch is best effort and should only be considered if it is low hanging fruit.
I suggest that we work in the following way in order to avoid accidentally doing work twice:
- Add your name the a task you like to work on before starting to write the unit tests.
- When you open a pr then add the PR number to task.
- Once the pr is merged, then check off the task.
Note that aggregations are tested, however due to how before the code was structured, unit testing was really difficult.