-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing of DateHistogramBucket key (#131)
Signed-off-by: Thomas Farr <[email protected]>
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Threading; | ||
using OpenSearch.Client; | ||
using OpenSearch.OpenSearch.Xunit.XunitPlumbing; | ||
using Tests.Core.Extensions; | ||
using Tests.Core.ManagedOpenSearch.Clusters; | ||
using Tests.Domain; | ||
|
||
namespace Tests.Reproduce | ||
{ | ||
/// <summary> | ||
/// Parsing histogram interval failed: <a href="https://github.com/opensearch-project/opensearch-net/issues/130">Issue #130</a> | ||
/// </summary> | ||
/// | ||
public class GitHubIssue130 : IClusterFixture<WritableCluster> | ||
{ | ||
private readonly WritableCluster _cluster; | ||
|
||
public GitHubIssue130(WritableCluster cluster) => _cluster = cluster; | ||
|
||
[I] public void CanDeserializeDateHistogramBucket() | ||
{ | ||
var response = _cluster.Client.Search<Project>(c => c | ||
.Size(0) | ||
.Query(q => q.MatchAll()) | ||
.Aggregations(a => a.Histogram("aggregation_ranges", r => r | ||
.Field(f => f.LastActivity) | ||
.Interval(5000) | ||
) | ||
) | ||
); | ||
|
||
response.ShouldBeValid(); | ||
} | ||
} | ||
} |