Skip to content

Commit c173c53

Browse files
committed
Sampler agg test for bg count should only be asserted 5.5.0 and up
1 parent 0c2f0ae commit c173c53

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

src/Tests/Aggregations/Bucket/Sampler/SamplerAggregationUsageTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ protected override void ExpectResponse(ISearchResponse<Project> response)
6969
sample.Should().NotBeNull();
7070
var sigTags = sample.SignificantTerms("significant_names");
7171
sigTags.Should().NotBeNull();
72-
sigTags.BgCount.Should().BeGreaterThan(0);
7372
sigTags.DocCount.Should().BeGreaterThan(0);
73+
if (TestClient.VersionUnderTestSatisfiedBy(">=5.5.0"))
74+
sigTags.BgCount.Should().BeGreaterThan(0);
7475
}
7576
}
7677
}

src/Tests/ClientConcepts/Certificates/SslAndKpiXPackCluster.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,6 @@ public abstract class SslAndKpiXPackCluster : XPackCluster
3131
"xpack.security.http.ssl.enabled=true",
3232
};
3333

34-
// private static readonly object _lock = new object();
35-
// private static int _port = 9200;
36-
// private int? _desiredPort;
37-
// public override int DesiredPort
38-
// {
39-
// get
40-
// {
41-
// lock (_lock)
42-
// {
43-
// if (!this._desiredPort.HasValue)
44-
// this._desiredPort = ++_port;
45-
// return this._desiredPort.Value;
46-
// }
47-
// }
48-
// }
49-
5034
public override ConnectionSettings ClusterConnectionSettings(ConnectionSettings s) =>
5135
this.ConnectionSettings(Authenticate(s));
5236

src/Tests/Framework/ManagedElasticsearch/Clusters/XPackCluster.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Linq;
1+
using System;
2+
using System.Linq;
23
using Nest;
34
using Tests.Framework.Integration;
45
using Tests.Framework.ManagedElasticsearch.Plugins;
@@ -8,10 +9,11 @@ namespace Tests.Framework.ManagedElasticsearch.Clusters
89
[RequiresPlugin(ElasticsearchPlugin.XPack)]
910
public class XPackCluster : ClusterBase
1011
{
11-
protected override string[] AdditionalServerSettings => base.AdditionalServerSettings.Concat(new[]
12-
{
13-
"xpack.security.authc.token.enabled=true"
14-
}).ToArray();
12+
protected string[] XPackSettings => TestClient.VersionUnderTestSatisfiedBy(">=5.5.0")
13+
? new[] {"xpack.security.authc.token.enabled=true"}
14+
: Array.Empty<string>();
15+
16+
protected override string[] AdditionalServerSettings => base.AdditionalServerSettings.Concat(this.XPackSettings).ToArray();
1517

1618
public override ConnectionSettings ClusterConnectionSettings(ConnectionSettings s) =>
1719
s.BasicAuthentication("es_admin", "es_admin");

0 commit comments

Comments
 (0)