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 #23305FilterAggregator
@colings86 #23826FiltersAggregator
@jimczi #22678 GeoHashGridAggregator
@martijnvg #23417GlobalAggregator
@nik9000 #22668DateHistogramAggregator
@tlrx #22714HistogramAggregator
@jpountz #22961MissingAggregator
@jimczi #23895NestedAggregator
@polyfractalReverseNestedAggregator
@cbuescherRangeAggregator
(also test with DateRangeAggregationBuilder
and GeoDistanceAggregationBuilder
) @tlrx #24569BinaryRangeAggregator
(also test with IpRangeAggregationBuilder
) @jimczi #23255DiversifiedBytesHashSamplerAggregator
, DiversifiedMapSamplerAggregator
, DiversifiedNumericSamplerAggregator
and DiversifiedOrdinalsSamplerAggregator
. @martijnvg #23511SamplerAggregator
@nik9000 #23243GlobalOrdinalsSignificantTermsAggregator
, GlobalOrdinalsSignificantTermsAggregator.WithHash
, SignificantLongTermsAggregator
and SignificantStringTermsAggregator
. @markharwood #24904DoubleTermsAggregator
, GlobalOrdinalsStringTermsAggregator. LowCardinality
, GlobalOrdinalsStringTermsAggregator. WithHash
, LongTermsAggregator
and StringTermsAggregator
. @martijnvg #24949BestBucketsDeferringCollector
@MaineC #23511BestDocsDeferringCollector
@polyfractal #23511AvgAggregator
@cbuescher #23000CardinalityAggregator
@colings86 #23826GeoBoundsAggregator
@jimczi #23259GeoCentroidAggregator
@martijnvg #24111MaxAggregator
@nik9000 #22668MinAggregator
[MvG] #22279TDigestPercentilesAggregator
and HDRPercentilesAggregator
@tlrx #24245TDigestPercentileRanksAggregator
and HDRPercentileRanksAggregator
. @jpountz #23240ScriptedMetricAggregator
@cbuescher #23404StatsAggregator
@jimcziExtendedStatsAggregator
@jimcziSumAggregator
@martijnvg #22954TopHitsAggregator
@nik9000 #22754ValueCountAggregator
@tlrx #22741MatrixStatsAggregator
@martijnvg #24837We should also add tests for the following InternalAggregation
implementations:
(to test the reduce and result serialization logic)
InternalChildren
@cbuescher #23261InternalFilter
@colings86 #23388InternalFilters
@jimczi #22678 InternalGeoHashGrid
@martijnvg #23417InternalGlobal
@nik9000 #23388InternalHistogram
@jpountz #22961InternalDateHistogram
@tlrx #23402InternalMissing
@MaineC #23388InternalNested
@polyfractal #23388InternalReverseNested
@cbuescher #23388InternalRange
, InternalDateRange
, InternalGeoDistance
. @tlrx #24569InternalBinaryRange
@jimczi #23259InternalSampler
@martijnvg edada2581e75400da9fac82bdfbc7ec1f02ef0d8SignificantLongTerms
and SignificantStringTerms
. @tlrx #23428 DoubleTerms
, LongTerms
, StringTerms
and UnmappedTerms
. @jpountz #23149InternalAvg
@cbuescher #23000InternalCardinality
@colings86 #23826InternalGeoBounds
@jimczi #23259 InternalGeoCentroid
@martijnvg #24176InternalMax
@nik9000 #22668InternalMin
@colings86 + @nik9000 #22668InternalTDigestPercentiles
(#24090) and InternalHDRPercentiles
(#24157) @tlrxInternalTDigestPercentileRanks
and InternalHDRPercentileRanks
. @jpountz #23240InternalScriptedMetric
@cbuescher #23330InternalStats
@jimcziInternalExtendedStats
@jimcziInternalSum
@martijnvg #22954InternalTopHits
@nik9000InternalValueCount
@tlrx #22741InternalMatrixStats
@martijnvg #24559I 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:
Note that aggregations are tested, however due to how before the code was structured, unit testing was really difficult.
Would anyone mind if I worked on something for all subclasses or InternalSingleBucketAggregation
? I'd be able to click a lot of check boxes.....
Would anyone mind if I worked on something for all subclasses or InternalSingleBucketAggregation? I'd be able to click a lot of check boxes.....
I merged #23388.
All tasks for this ticket have now been completed 馃帀
Most helpful comment
All tasks for this ticket have now been completed 馃帀