Skip to content

Commit 997e6fe

Browse files
committed
Ignore ip_range in version <5.5.0
This commit adds a mapping inference to ignore the Ips property on Ranges when the version under test is <5.5.0.
1 parent 799ec1c commit 997e6fe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Tests/Framework/TestClient.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ private static ConnectionSettings DefaultSettings(ConnectionSettings settings) =
6767
.DefaultIndex("default-index")
6868
.PrettyJson()
6969
.InferMappingFor<Project>(ProjectMapping)
70+
.InferMappingFor<Ranges>(RangesMapping)
7071
.InferMappingFor<CommitActivity>(map => map
7172
.IndexName("project")
7273
.TypeName("commits")
@@ -104,6 +105,15 @@ private static IClrTypeMapping<Project> ProjectMapping(ClrTypeMappingDescriptor<
104105
m.Ignore(p => p.Ranges);
105106
return m;
106107
}
108+
109+
private static IClrTypeMapping<Ranges> RangesMapping(ClrTypeMappingDescriptor<Ranges> m)
110+
{
111+
//ip_range type only available since 5.5.0 so we ignore them when running integration tests
112+
if (VersionUnderTestSatisfiedBy("<5.5.0") && Configuration.RunIntegrationTests)
113+
m.Ignore(p => p.Ips);
114+
return m;
115+
}
116+
107117
public static string PercolatorType => Configuration.ElasticsearchVersion <= ElasticsearchVersion.GetOrAdd("5.0.0-alpha1")
108118
? ".percolator"
109119
: "query";

0 commit comments

Comments
 (0)