Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix CI
  • Loading branch information
mgravell committed Mar 20, 2026
commit 44c9514508d13bdefd71460f95671a722545968a
18 changes: 18 additions & 0 deletions tests/NRedisStack.Tests/EndpointsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,24 @@ public static IEnumerable<object[]> StandaloneOnly()

public static Version RedisVersion = new(Environment.GetEnvironmentVariable("REDIS_VERSION") ?? "0.0.0");

public static bool IsAtLeast(int major, int minor = 0, int build = 0, int revision = 0)
{
var version = RedisVersion;
if (version.Major > major) return true;
if (version.Major < major) return false;

// if here, we're a match on major; test minor
if (version.Minor > minor) return true;
if (version.Minor < minor) return false;

// if here, we're a match on minor; test build
if (version.Build > build) return true;
if (version.Build < build) return false;

// if here, we're a match on build; test revision
return version.Revision >= revision;
}
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

public EndpointsFixture()
{
if (redisEndpointsPath != null && File.Exists(redisEndpointsPath))
Expand Down
4 changes: 3 additions & 1 deletion tests/NRedisStack.Tests/Search/SearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ private static void SkipClusterPre8(string endpointId)
// is released as part of Redis v8.2.x
Assert.SkipWhen(endpointId == EndpointsFixture.Env.Cluster
&& !EndpointsFixture.IsEnterprise
&& EndpointsFixture.RedisVersion.Major == 8
&& EndpointsFixture.RedisVersion.Minor < 4, "Ignoring cluster tests for FT.SEARCH pre Redis 8.4");
}

Expand Down Expand Up @@ -1662,7 +1663,8 @@ public void TestDropIndex(string endpointId)

Assert.NotNull(ex);
Assert.IsType<RedisServerException>(ex);
Assert.Contains("no such index", ex.Message, StringComparison.OrdinalIgnoreCase);
var fault = EndpointsFixture.IsAtLeast(8, 8) ? "index not found" : "no such index";
Assert.Contains(fault, ex.Message, StringComparison.OrdinalIgnoreCase);
}

private int DatabaseSize(IDatabase db) => DatabaseSize(db, out _);
Expand Down
Loading