Skip to content

Skip DateHistogram aggregations for <7.2.0 #4943

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
Aug 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System;
using System;
using System.Linq;
using Elastic.Elasticsearch.Xunit.XunitPlumbing;
using FluentAssertions;
using Nest;
using Tests.Core.Extensions;
Expand All @@ -26,6 +27,7 @@ namespace Tests.Aggregations.Bucket.DateHistogram
*
* Be sure to read the Elasticsearch documentation on {ref_current}/search-aggregations-bucket-datehistogram-aggregation.html[Date Histogram Aggregation].
*/
[SkipVersion("<7.2.0", "Uses calendar_interval which was introduced in 7.2.0")]
public class DateHistogramAggregationUsageTests : ProjectsOnlyAggregationUsageTestBase
{
public DateHistogramAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : base(i, usage) { }
Expand Down Expand Up @@ -68,7 +70,6 @@ public DateHistogramAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage
}
};

#pragma warning disable 618, 612
protected override Func<AggregationContainerDescriptor<Project>, IAggregationContainer> FluentAggs => a => a
.DateHistogram("projects_started_per_month", date => date
.Field(p => p.StartedOn)
Expand Down Expand Up @@ -111,7 +112,6 @@ public DateHistogramAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage
}
}
};
#pragma warning restore 618, 612

protected override void ExpectResponse(ISearchResponse<Project> response)
{
Expand Down Expand Up @@ -141,6 +141,7 @@ protected override void ExpectResponse(ISearchResponse<Project> response)
}

// hide
[SkipVersion("<7.2.0", "Uses fixed_interval which was introduced in 7.2.0")]
public class DateHistogramAggregationNoSubAggregationsUsageTests : ProjectsOnlyAggregationUsageTestBase
{
public DateHistogramAggregationNoSubAggregationsUsageTests(ReadOnlyCluster i, EndpointUsage usage) : base(i, usage) { }
Expand All @@ -166,7 +167,6 @@ public DateHistogramAggregationNoSubAggregationsUsageTests(ReadOnlyCluster i, En
}
};

#pragma warning disable 618, 612
protected override Func<AggregationContainerDescriptor<Project>, IAggregationContainer> FluentAggs => a => a
.DateHistogram("projects_started_per_four_weeks", date => date
.Field(p => p.StartedOn)
Expand All @@ -193,7 +193,6 @@ public DateHistogramAggregationNoSubAggregationsUsageTests(ReadOnlyCluster i, En
Order = HistogramOrder.CountAscending,
Missing = FixedDate
};
#pragma warning restore 618, 612

protected override void ExpectResponse(ISearchResponse<Project> response)
{
Expand Down