Skip to content

Commit 9634ddf

Browse files
committed
Merge branch 'develop' of github.com:elasticsearch/elasticsearch-net into develop
2 parents e2184bc + 554d1ce commit 9634ddf

File tree

7 files changed

+28
-13
lines changed

7 files changed

+28
-13
lines changed

Diff for: src/Tests/Nest.Tests.Integration/Aggregations/MetricAggregationTests.cs

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public void ValueCount()
122122
}
123123

124124
[Test]
125+
[SkipVersion("0 - 1.2.9", "Percentile ranks agg added in 1.3")]
125126
public void PercentilesRank()
126127
{
127128
var results = this.Client.Search<ElasticsearchProject>(s => s
@@ -140,6 +141,7 @@ public void PercentilesRank()
140141
}
141142

142143
[Test]
144+
[SkipVersion("0 - 1.3.0", "Fails against 1.3: https://github.com/elasticsearch/elasticsearch/issues/7004")]
143145
public void GeoBounds()
144146
{
145147
var results = this.Client.Search<ElasticsearchProject>(s => s
@@ -165,6 +167,7 @@ public void GeoBounds()
165167
}
166168

167169
[Test]
170+
[SkipVersion("0 - 1.2.9", "Top hits agg added in 1.3")]
168171
public void TopHits()
169172
{
170173
var results = this.Client.Search<ElasticsearchProject>(s => s

Diff for: src/Tests/Nest.Tests.Integration/Aggregations/NestedBucketAggregationTests.cs

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public void MultipleTermsInTerms()
7777
}
7878

7979
[Test]
80+
[SkipVersion("0 - 1.1.9", "Reverse nested agg added in 1.2.0")]
8081
public void ReverseNested()
8182
{
8283
var results = this.Client.Search<ElasticsearchProject>(s => s

Diff for: src/Tests/Nest.Tests.Integration/Core/Cat/CatTests.cs

+10-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ private async Task TestCatAsync<TRecord>(Func<Task<ICatResponse<TRecord>>> call,
4242

4343

4444
[Test]
45+
[SkipVersion("0 - 1.0.3", "Fails on ES < 1.1")]
4546
public void CatAliases()
4647
{
4748
TestCat(() => this._client.CatAliases(s => s.V()), r => !r.Alias.IsNullOrEmpty());
4849
}
4950

5051
[Test]
52+
[SkipVersion("0 - 1.0.3", "Fails on ES < 1.1")]
5153
public async void CatAliasesAsync()
5254
{
5355
await TestCatAsync(() => this._client.CatAliasesAsync(), r => !r.Alias.IsNullOrEmpty());
@@ -78,6 +80,7 @@ public async void CatCountAsync()
7880
}
7981

8082
[Test]
83+
[SkipVersion("0 - 1.1.9", "/_cat/fielddata endpoint added in 1.2")]
8184
public void CatFielddata()
8285
{
8386
TestCat(() => this._client.CatFielddata(
@@ -87,6 +90,7 @@ public void CatFielddata()
8790
}
8891

8992
[Test]
93+
[SkipVersion("0 - 1.1.9", "/_cat/fielddata endpoint added in 1.2")]
9094
public async void CatFielddataAsync()
9195
{
9296
await TestCatAsync(() => this._client.CatFielddataAsync(v => v.Fields<ElasticsearchProject>(p => p.Name)), r => r.FieldSizes.ContainsKey("name"));
@@ -157,24 +161,28 @@ public async void CatPendingTasksAsync()
157161
}
158162

159163
[Test]
164+
[SkipVersion("0 - 1.1.0", "Fails on ES <= 1.1.0 (#5778)")]
160165
public void CatPlugins()
161166
{
162167
TestCat(() => this._client.CatPlugins(), r => !r.Version.IsNullOrEmpty());
163168
}
164169

165170
[Test]
171+
[SkipVersion("0 - 1.1.0", "Fails on ES <= 1.1.0 (#5778)")]
166172
public async void CatPluginsAsync()
167173
{
168174
await TestCatAsync(() => this._client.CatPluginsAsync(), r => !r.Type.IsNullOrEmpty());
169175
}
170176

171177
[Test]
178+
[SkipVersion("0 - 1.0.3", "Fails on ES < 1.1")]
172179
public void CatRecovery()
173180
{
174181
TestCat(() => this._client.CatRecovery(), r => !r.Shard.IsNullOrEmpty());
175182
}
176183

177184
[Test]
185+
[SkipVersion("0 - 1.0.3", "Fails on ES < 1.1")]
178186
public async void CatRecoveryAsync()
179187
{
180188
await TestCatAsync(() => this._client.CatRecoveryAsync(), r => !r.Files.IsNullOrEmpty());
@@ -194,13 +202,13 @@ public async void CatThreadPoolAsync()
194202
[Test]
195203
public void CatShards()
196204
{
197-
TestCat(() => this._client.CatShards(), r => !r.Node.IsNullOrEmpty());
205+
TestCat(() => this._client.CatShards(), r => !r.State.IsNullOrEmpty());
198206
}
199207

200208
[Test]
201209
public async void CatShardsAsync()
202210
{
203-
await TestCatAsync(() => this._client.CatShardsAsync(), r => !r.Docs.IsNullOrEmpty());
211+
await TestCatAsync(() => this._client.CatShardsAsync(), r => !r.State.IsNullOrEmpty());
204212
}
205213

206214
}

Diff for: src/Tests/Nest.Tests.Integration/Core/Repository/RestoreStatusTests.cs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Nest.Tests.Integration.Core.Repository
1010
public class RestoreStatusTests : IntegrationTests
1111
{
1212
[Test]
13+
[SkipVersion("0 - 1.0.9", "Snapshot status added in 1.1.0")]
1314
public void SnapshotRestore()
1415
{
1516
var indexName = ElasticsearchConfiguration.NewUniqueIndexName();

Diff for: src/Tests/Nest.Tests.Integration/Core/Repository/SnapshotStatusTests.cs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Nest.Tests.Integration.Core.Repository
1010
public class SnapshotStatusTests : IntegrationTests
1111
{
1212
[Test]
13+
[SkipVersion("0 - 1.0.9", "Snapshot status added in 1.1.0")]
1314
public void SnapshotRestoreFullPath()
1415
{
1516
var repositoryName = ElasticsearchConfiguration.NewUniqueIndexName();
@@ -46,6 +47,7 @@ public void SnapshotRestoreFullPath()
4647

4748
}
4849
[Test]
50+
[SkipVersion("0 - 1.0.9", "Snapshot status added in 1.1.0")]
4951
public void SnapshotRestoreOnlyRepository()
5052
{
5153
var repositoryName = ElasticsearchConfiguration.NewUniqueIndexName();

Diff for: src/Tests/Nest.Tests.Integration/Search/FieldTests/FieldsTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void Search_WithFieldsRemoved_ReturnsDocuments_ResultingArrayOfDocsShould
2828
s.Skip(0)
2929
.Take(10)
3030
.Fields(fields.ConvertAll(x => x.ToCamelCase()).ToArray())
31-
.AllTypes());
31+
);
3232

3333
Assert.True(queryResults.IsValid);
3434

Diff for: src/Tests/Nest.Tests.Integration/Search/Scroll/ScrollTests.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ public void SearchTypeScan()
2424
Assert.False(scanResults.FieldSelections.Any());
2525
Assert.IsNotNullOrEmpty(scanResults.ScrollId);
2626

27-
var scrolls = 0;
2827
var results = this.Client.Scroll<ElasticsearchProject>(s=>s
2928
.Scroll("4s")
3029
.ScrollId(scanResults.ScrollId)
3130
);
31+
var hitCount = results.Hits.Count();
3232
while (results.FieldSelections.Any())
3333
{
3434
Assert.True(results.IsValid);
@@ -38,9 +38,9 @@ public void SearchTypeScan()
3838
results = this.Client.Scroll<ElasticsearchProject>(s=>s
3939
.Scroll("4s")
4040
.ScrollId(localResults.ScrollId));
41-
scrolls++;
41+
hitCount += results.Hits.Count();
4242
}
43-
Assert.AreEqual(18, scrolls);
43+
Assert.AreEqual(scanResults.Total, hitCount);
4444
}
4545

4646
[Test]
@@ -58,21 +58,21 @@ public void SearchTypeScan_ObjectInitializer()
5858
Assert.False(scanResults.FieldSelections.Any());
5959
Assert.IsNotNullOrEmpty(scanResults.ScrollId);
6060

61-
var scrolls = 0;
6261
var results = this.Client.Scroll<ElasticsearchProject>(s=>s
6362
.Scroll("4s")
6463
.ScrollId(scanResults.ScrollId)
6564
);
65+
var hitCount = results.Hits.Count();
6666
while (results.FieldSelections.Any())
6767
{
6868
Assert.True(results.IsValid);
6969
Assert.True(results.FieldSelections.Any());
7070
Assert.IsNotNullOrEmpty(results.ScrollId);
7171
var localResults = results;
7272
results = this.Client.Scroll<ElasticsearchProject>(new ScrollRequest(localResults.ScrollId, "4s"));
73-
scrolls++;
73+
hitCount += results.Hits.Count();
7474
}
75-
Assert.AreEqual(18, scrolls);
75+
Assert.AreEqual(scanResults.Total, hitCount);
7676
}
7777

7878
[Test]
@@ -90,11 +90,11 @@ public void SearchTypeScanMoreThanOne()
9090
Assert.False(scanResults.FieldSelections.Any());
9191
Assert.IsNotNullOrEmpty(scanResults.ScrollId);
9292

93-
var scrolls = 0;
9493
var results = this.Client.Scroll<ElasticsearchProject>(s =>s
9594
.Scroll("4s")
9695
.ScrollId(scanResults.ScrollId));
97-
results.FieldSelections.Count().Should().Be(18);
96+
results.FieldSelections.Count().Should().Be((int)scanResults.Total);
97+
var hitCount = results.Hits.Count();
9898
while (results.FieldSelections.Any())
9999
{
100100
Assert.True(results.IsValid);
@@ -104,9 +104,9 @@ public void SearchTypeScanMoreThanOne()
104104
results = this.Client.Scroll<ElasticsearchProject>(s=>s
105105
.Scroll("4s")
106106
.ScrollId(results1.ScrollId));
107-
scrolls++;
107+
hitCount += results.Hits.Count();
108108
}
109-
Assert.AreEqual(1, scrolls);
109+
Assert.AreEqual(scanResults.Total, hitCount);
110110
}
111111
}
112112
}

0 commit comments

Comments
 (0)