Skip to content

Increase InternalDateHistogramTests coverage #36064

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

Merged
merged 1 commit into from
Nov 30, 2018

Conversation

javanna
Copy link
Member

@javanna javanna commented Nov 29, 2018

In this test we were randomizing different values but minDocCount was hardcoded to 1. It's important to test other values, especially 0 as it's the default. The test needed some adapting in the way buckets are randomly generated: all aggs need to share the same interval, minDocCount and emptyBucketInfo. Also assertions need to take into account that more (or less) buckets are expected depending on minDocCount.

In this test we were randomizing different values but minDocCount was hardcoded to 1. It's important to test other values, especially `0` as it's the default. The test needed some adapting in the way buckets are randomly generated: all aggs need to share the same interval, minDocCount and emptyBucketInfo. Also assertions need to take into account that more (or less) buckets are expected depending on minDocCount.
@javanna javanna added >test Issues or PRs that are addressing/adding tests :Analytics/Aggregations Aggregations v7.0.0 v6.6.0 labels Nov 29, 2018
@javanna javanna requested a review from jimczi November 29, 2018 16:29
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@javanna javanna changed the title [TEST] Increase InternalDateHistogramTests coverage Increase InternalDateHistogramTests coverage Nov 29, 2018
Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

LGTM

@javanna javanna merged commit e3eb05b into elastic:master Nov 30, 2018
javanna added a commit that referenced this pull request Nov 30, 2018
New that we test with min_doc_count set to 0 as well, we may end up generating a lot more buckets. This commit adjusts the min bound and max bound, as well as the offset for each randomly generated agg instance so that we don't end up hitting the 10.000 max buckets limit.

Relates to #36064
javanna added a commit that referenced this pull request Dec 3, 2018
In this test we were randomizing different values but minDocCount was hardcoded to 1. It's important to test other values, especially `0` as it's the default. The test needed some adapting in the way buckets are randomly generated: all aggs need to share the same interval, minDocCount and emptyBucketInfo. Also assertions need to take into account that more (or less) buckets are expected depending on minDocCount.
javanna added a commit that referenced this pull request Dec 3, 2018
New that we test with min_doc_count set to 0 as well, we may end up generating a lot more buckets. This commit adjusts the min bound and max bound, as well as the offset for each randomly generated agg instance so that we don't end up hitting the 10.000 max buckets limit.

Relates to #36064
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 v6.6.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants