Skip to content

Commit f546bde

Browse files
authored
Fix integration tests in 7.x (#4368)
- A previous fix in 91f446d only works for `latest-7` not previous versions - Make SLM assertions on state less rigid
1 parent 91f446d commit f546bde

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tests/Tests/Search/SearchTemplate/SearchTemplateApiTests.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Elasticsearch.Net;
55
using FluentAssertions;
66
using Nest;
7+
using Tests.Configuration;
78
using Tests.Core.ManagedElasticsearch.Clusters;
89
using Tests.Domain;
910
using Tests.Framework.EndpointTests;
@@ -103,7 +104,10 @@ protected override LazyResponses ClientUsage() => Calls(
103104
protected override void ExpectResponse(ISearchResponse<Project> response)
104105
{
105106
response.ServerError.Should().NotBeNull();
106-
response.ServerError.Error.Reason.Should().Contain("unknown query [atch]");
107+
if (TestConfiguration.Instance.ElasticsearchVersion <= "7.5.0")
108+
response.ServerError.Error.Reason.Should().Contain("no [query]");
109+
else
110+
response.ServerError.Error.Reason.Should().Contain("unknown query [atch]");
107111
}
108112
}
109113
}

tests/Tests/XPack/Slm/SlmApiTests.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ [I] public async Task GetSnapshotLifecycleStatusResponse() => await Assert<GetSn
252252
{
253253
r.IsValid.Should().BeTrue();
254254
r.ApiCall.HttpStatusCode.Should().Be(200);
255-
r.OperationMode.Should().Be(LifecycleOperationMode.Running);
255+
var m = r.OperationMode;
256+
var rightOperationMode =
257+
m == LifecycleOperationMode.Running || m == LifecycleOperationMode.Stopped;
258+
rightOperationMode.Should().BeTrue();
256259
});
257260

258261
[I] public async Task StopSnapshotLifecycleResponse() => await Assert<StopSnapshotLifecycleManagementResponse>(StopSnapshotLifecycleStep, (v, r) =>

0 commit comments

Comments
 (0)