Skip to content

Commit

Permalink
Fix integration tests in 7.x (#4368)
Browse files Browse the repository at this point in the history
- A previous fix in 91f446d only works for `latest-7` not previous
versions
- Make SLM assertions on state less rigid
  • Loading branch information
Mpdreamz authored Feb 6, 2020
1 parent 91f446d commit f546bde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/Tests/Search/SearchTemplate/SearchTemplateApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Elasticsearch.Net;
using FluentAssertions;
using Nest;
using Tests.Configuration;
using Tests.Core.ManagedElasticsearch.Clusters;
using Tests.Domain;
using Tests.Framework.EndpointTests;
Expand Down Expand Up @@ -103,7 +104,10 @@ protected override LazyResponses ClientUsage() => Calls(
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ServerError.Should().NotBeNull();
response.ServerError.Error.Reason.Should().Contain("unknown query [atch]");
if (TestConfiguration.Instance.ElasticsearchVersion <= "7.5.0")
response.ServerError.Error.Reason.Should().Contain("no [query]");
else
response.ServerError.Error.Reason.Should().Contain("unknown query [atch]");
}
}
}
5 changes: 4 additions & 1 deletion tests/Tests/XPack/Slm/SlmApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ [I] public async Task GetSnapshotLifecycleStatusResponse() => await Assert<GetSn
{
r.IsValid.Should().BeTrue();
r.ApiCall.HttpStatusCode.Should().Be(200);
r.OperationMode.Should().Be(LifecycleOperationMode.Running);
var m = r.OperationMode;
var rightOperationMode =
m == LifecycleOperationMode.Running || m == LifecycleOperationMode.Stopped;
rightOperationMode.Should().BeTrue();
});

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

0 comments on commit f546bde

Please sign in to comment.