Skip to content

Commit 92f5c96

Browse files
committed
Added SkipVersion attribute to tests where appropriate after adding support for ES 1.4 features
1 parent de942bd commit 92f5c96

File tree

9 files changed

+46
-8
lines changed

9 files changed

+46
-8
lines changed

src/Tests/Nest.Tests.Integration/Aggregations/BucketAggregationTests.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,25 @@ public void SignificantTermsWithBackgroundFilter()
8686

8787
[Test]
8888
public void Histogram()
89+
{
90+
var results = this.Client.Search<ElasticsearchProject>(s => s
91+
.Size(0)
92+
.Aggregations(a => a
93+
.Histogram("bucket_agg", m => m
94+
.Field(p => p.IntValues)
95+
.Interval(10)
96+
)
97+
98+
)
99+
);
100+
results.IsValid.Should().BeTrue();
101+
var bucket = results.Aggs.Histogram("bucket_agg");
102+
bucket.Items.Should().NotBeEmpty();
103+
}
104+
105+
[Test]
106+
[SkipVersion("0 - 1.3.9", "pre_offset and post_offset added in ES 1.4")]
107+
public void HistogramWithOffsets()
89108
{
90109
var results = this.Client.Search<ElasticsearchProject>(s => s
91110
.Size(0)
@@ -99,6 +118,7 @@ public void Histogram()
99118

100119
)
101120
);
121+
102122
results.IsValid.Should().BeTrue();
103123
var bucket = results.Aggs.Histogram("bucket_agg");
104124
bucket.Items.Should().NotBeEmpty();

src/Tests/Nest.Tests.Integration/Aggregations/FIltersAggregationTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class FiltersAggregationTests : IntegrationTests
1111
private readonly string _indexedName = NestTestData.Data[3].Name;
1212
private readonly string _indexedCountry = NestTestData.Data[2].Country;
1313
[Test]
14+
[SkipVersion("0 - 1.3.9", "Filters aggregation added in ES 1.4")]
1415
public void NamedFilters()
1516
{
1617

@@ -43,6 +44,7 @@ public void NamedFilters()
4344
}
4445

4546
[Test]
47+
[SkipVersion("0 - 1.3.9", "Filters aggregation added in ES 1.4")]
4648
public void AnonymousFilters()
4749
{
4850
var results = this.Client.Search<ElasticsearchProject>(s => s

src/Tests/Nest.Tests.Integration/Aggregations/SingleBucketAggregationTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public void Global()
6262
}
6363

6464
[Test]
65+
[SkipVersion("0 - 1.3.9", "Children aggregation added in ES 1.4")]
6566
public void Children()
6667
{
6768
var results = this.Client.Search<Parent>(s => s

src/Tests/Nest.Tests.Integration/Core/Exists/SearchExistsTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace Nest.Tests.Integration.Core.Exists
99
public class SearchExistsTests : IntegrationTests
1010
{
1111
[Test]
12+
[SkipVersion("0 - 1.3.9", "Search exists api added in ES 1.4")]
1213
public void ShouldNotExist_WrongIndex()
1314
{
1415
var r = this.Client.SearchExists<ElasticsearchProject>(f=>f.Index("yadadadadadaadada"));
@@ -18,6 +19,7 @@ public void ShouldNotExist_WrongIndex()
1819
}
1920

2021
[Test]
22+
[SkipVersion("0 - 1.3.9", "Search exists api added in ES 1.4")]
2123
public void ShouldNotExist_WrongData()
2224
{
2325
var lookfor = NestTestData.Data.First().Country + "blah";
@@ -28,6 +30,7 @@ public void ShouldNotExist_WrongData()
2830
}
2931

3032
[Test]
33+
[SkipVersion("0 - 1.3.9", "Search exists api added in ES 1.4")]
3134
public void ShouldExist()
3235
{
3336
var lookfor = NestTestData.Data.First().Country;

src/Tests/Nest.Tests.Integration/Core/Repository/CreateRepositoryTests.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ public void CreateAndValidateAndDeleteRepository_ThenSnapshotWithWait()
2323
createReposResult.IsValid.Should().BeTrue();
2424
createReposResult.Acknowledged.Should().BeTrue();
2525

26-
var validateResponse = this.Client.VerifyRepository(new VerifyRepositoryRequest(repositoryName));
27-
validateResponse.IsValid.Should().BeTrue();
26+
// Repository verification added in ES 1.4
27+
if (ElasticsearchConfiguration.CurrentVersion > new Version("1.3.9"))
28+
{
29+
var validateResponse = this.Client.VerifyRepository(new VerifyRepositoryRequest(repositoryName));
30+
validateResponse.IsValid.Should().BeTrue();
2831

29-
validateResponse.Nodes.Should().NotBeEmpty();
30-
var kv = validateResponse.Nodes.First();
31-
kv.Key.Should().NotBeNullOrWhiteSpace();
32-
kv.Value.Should().NotBeNull();
33-
kv.Value.Name.Should().NotBeNullOrWhiteSpace();
32+
validateResponse.Nodes.Should().NotBeEmpty();
33+
var kv = validateResponse.Nodes.First();
34+
kv.Key.Should().NotBeNullOrWhiteSpace();
35+
kv.Value.Should().NotBeNull();
36+
kv.Value.Name.Should().NotBeNullOrWhiteSpace();
37+
}
3438

3539
var backupName = ElasticsearchConfiguration.NewUniqueIndexName();
3640
var snapshotResponse = this.Client.Snapshot(repositoryName, backupName, selector: f => f
@@ -59,7 +63,7 @@ public void CreateAndValidateAndDeleteRepository_ThenSnapshotWithWait()
5963
deleteReposResult.IsValid.Should().BeTrue();
6064
deleteReposResult.Acknowledged.Should().BeTrue();
6165
}
62-
66+
6367
[Test]
6468
public void CreateAndDeleteRepository_ThenSnapshotWithoutWait()
6569
{

src/Tests/Nest.Tests.Integration/Core/TermVectors/TermVectorTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public void TermVectorDefaultsTest()
2222
}
2323

2424
[Test]
25+
[SkipVersion("0 - 1.3.9", "Term vector artificial documents added in ES 1.4")]
2526
public void TermVectorDocument()
2627
{
2728
var document = NestTestData.Data.FirstOrDefault(d => d.Id == 1);
@@ -31,6 +32,7 @@ public void TermVectorDocument()
3132

3233
AssertContentsVectors(result);
3334
}
35+
3436
private static void AssertContentsVectors(ITermVectorResponse result)
3537
{
3638
result.IsValid.Should().BeTrue();

src/Tests/Nest.Tests.Integration/Indices/UpgradeTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace Nest.Tests.Integration.Indices
1212
public class UpgradeTests : IntegrationTests
1313
{
1414
[Test]
15+
[SkipVersion("0 - 1.3.9", "Upgrade api added in ES 1.4")]
1516
public void UpgradeAllTest()
1617
{
1718
var response = this.Client.Upgrade();
@@ -26,6 +27,7 @@ public void UpgradeAllTest()
2627
}
2728

2829
[Test]
30+
[SkipVersion("0 - 1.3.9", "Upgrade api added in ES 1.4")]
2931
public void UpgradeTest()
3032
{
3133
var index = ElasticsearchConfiguration.DefaultIndex;
@@ -41,6 +43,7 @@ public void UpgradeTest()
4143
}
4244

4345
[Test]
46+
[SkipVersion("0 - 1.3.9", "Upgrade api added in ES 1.4")]
4447
public void UpgradeStatusAllTest()
4548
{
4649
var response = this.Client.UpgradeStatus();
@@ -53,6 +56,7 @@ public void UpgradeStatusAllTest()
5356
}
5457

5558
[Test]
59+
[SkipVersion("0 - 1.3.9", "Upgrade api added in ES 1.4")]
5660
public void UpgradeStatusTest()
5761
{
5862
var index = ElasticsearchConfiguration.DefaultIndex;

src/Tests/Nest.Tests.Integration/Reproduce/Reproduce1181Tests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace Nest.Tests.Integration.Reproduce
1313
public class Reproduce1181Tests : IntegrationTests
1414
{
1515
[Test]
16+
[SkipVersion("0 - 1.3.9", "Filters aggregation added in ES 1.4")]
1617
public void FiltersAggregationResponseNotReadToCompletion()
1718
{
1819
var result = this.Client.Search<ElasticsearchProject>(s => s

src/Tests/Nest.Tests.Integration/Search/TerminateAfterTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Nest.Tests.Integration.Search
1111
public class TerminateAfterTests : IntegrationTests
1212
{
1313
[Test]
14+
[SkipVersion("0 - 1.3.9", "Terminate after added in ES 1.4")]
1415
public void TerminatedEarlyIsSet()
1516
{
1617
var queryResults = this.Client.Search<ElasticsearchProject>(s=>s

0 commit comments

Comments
 (0)