Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
max-parallel: 15
fail-fast: false
matrix:
redis-version: [ '8.6', '8.4', '8.2', '7.4', '7.2', '6.2']
redis-version: [ '8.8', '8.6', '8.4', '8.2', '7.4', '7.2', '6.2']
dotnet-version: ['8.0', '9.0', '10.0']
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
Expand Down
4 changes: 3 additions & 1 deletion tests/NRedisStack.Tests/CommunityEditionUpdatesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public void InfoSearchSection(string endpointId)
IServer server = getAnyPrimary(muxer);

var searchInfo = server.Info("search");
CustomAssertions.GreaterThan(searchInfo.Length, 8);
// v8.8 reduces a lot of noise around "info search" output
var expectCount = EndpointsFixture.IsAtLeast(8, 8) ? 2 : 8;
CustomAssertions.GreaterThan(searchInfo.Length, expectCount);
}

}
23 changes: 23 additions & 0 deletions tests/NRedisStack.Tests/EndpointsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,29 @@ 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;
// note: watch out for negative numbers (means "undefined") from parsing n-part strings
var test = Math.Max(version.Major, 0);
if (test > major) return true;
if (test < major) return false;

// if here, we're a match on major; test minor
test = Math.Max(version.Minor, 0); // interpret "9" as "9.0"
if (test > minor) return true;
if (test < minor) return false;

// if here, we're a match on minor; test build
test = Math.Max(version.Build, 0); // interpret "9.0" as "9.0.0"
if (test > build) return true;
if (test < build) return false;

// if here, we're a match on build; test revision
test = Math.Max(version.Revision, 0); // interpret "9.0.0" as "9.0.0.0"
return test >= revision;
}
Comment thread
cursor[bot] marked this conversation as resolved.

public EndpointsFixture()
{
if (redisEndpointsPath != null && File.Exists(redisEndpointsPath))
Expand Down
7 changes: 5 additions & 2 deletions 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 Expand Up @@ -1726,7 +1728,8 @@ public async Task TestDropIndexAsync(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);
}

[Theory]
Expand Down
6 changes: 6 additions & 0 deletions tests/dockers/.env.v8.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Environment variables for Redis 8.8
# Used by the run-tests GitHub Action

# Redis CE image version (Redis 8+ includes modules natively)
CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test:unstable-23321515778-debian

4 changes: 2 additions & 2 deletions tests/dockers/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
services:

redis:
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:8.4-GA-pre.3}
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:unstable-23321515778-debian}
Comment thread
mgravell marked this conversation as resolved.
container_name: redis-standalone
environment:
- TLS_ENABLED=yes
Expand All @@ -21,7 +21,7 @@ services:
- all

cluster:
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:8.4-GA-pre.3}
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:unstable-23321515778-debian}
container_name: redis-cluster
environment:
- REDIS_CLUSTER=yes
Expand Down
Loading