From aca6f28437e30f741b00db5c5475752978c90fd3 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Wed, 20 Dec 2023 14:02:59 +0200 Subject: [PATCH 01/44] NRedisStack Enterprise Test --- .github/workflows/integration.yml | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index ac6128a0..30da63bc 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -16,6 +16,50 @@ concurrency: cancel-in-progress: true jobs: + NRedisStack-Enterprise-Test: + name: NRedisStack Enterprise Test + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + steps: + - name: Clone Redis EE docker repository + run: | + git clone https://github.com/RedisLabs/redis-ee-docker.git redis-ee + - name: Install Docker-compose + run: | + DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + mkdir -p $DOCKER_CONFIG/cli-plugins + curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + - name: Build cluster + env: + IMAGE: redislabs/redis-internal:100.0.1-64402 + RE_USERNAME: test@test.com + RE_PASS: 12345 + RE_CLUSTER_NAME: test + OSS_CLUSTER: false + DB_PORT: 6379 + DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + run: | + cd redis-ee/ + ./build.sh + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: .NET Core 7 + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '7.0.x' + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true + - name: Test + run: dotnet test --environment="REDIS=172.0.0.1:6379" --no-build --verbosity normal + dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] uses: ./.github/workflows/reusable.yml From 83c750a9636f6dba58b27fded8b91d590d997b5f Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Wed, 20 Dec 2023 15:40:56 +0200 Subject: [PATCH 02/44] enters --- .github/workflows/integration.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 30da63bc..0ab83583 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -27,11 +27,13 @@ jobs: - name: Clone Redis EE docker repository run: | git clone https://github.com/RedisLabs/redis-ee-docker.git redis-ee + - name: Install Docker-compose run: | DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} mkdir -p $DOCKER_CONFIG/cli-plugins curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + - name: Build cluster env: IMAGE: redislabs/redis-internal:100.0.1-64402 @@ -51,12 +53,15 @@ jobs: - name: .NET Core 7 uses: actions/setup-dotnet@v2 + with: dotnet-version: '7.0.x' - name: Restore dependencies run: dotnet restore + - name: Build run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true + - name: Test run: dotnet test --environment="REDIS=172.0.0.1:6379" --no-build --verbosity normal From 2a263e12a6fe35e5132f7329b010f0beb2a37bcd Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Wed, 20 Dec 2023 16:43:02 +0200 Subject: [PATCH 03/44] try to change the image --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 0ab83583..a49480af 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -36,7 +36,7 @@ jobs: - name: Build cluster env: - IMAGE: redislabs/redis-internal:100.0.1-64402 + IMAGE: redislabs/redis:latest RE_USERNAME: test@test.com RE_PASS: 12345 RE_CLUSTER_NAME: test From a8f55e36cdd4fad1b9a337b103dcd47f878ec393 Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Thu, 21 Dec 2023 01:05:48 +0200 Subject: [PATCH 04/44] update the image as it was before --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index a49480af..0ab83583 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -36,7 +36,7 @@ jobs: - name: Build cluster env: - IMAGE: redislabs/redis:latest + IMAGE: redislabs/redis-internal:100.0.1-64402 RE_USERNAME: test@test.com RE_PASS: 12345 RE_CLUSTER_NAME: test From aa73521f7600c1f8125f7d475166fda198d1ca6d Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Thu, 21 Dec 2023 12:56:18 +0200 Subject: [PATCH 05/44] add --environment="NUM_REDIS_CLUSTER_NODES=6" to dotnet test --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 0ab83583..c4e1cfd5 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -63,7 +63,7 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test --environment="REDIS=172.0.0.1:6379" --no-build --verbosity normal + run: dotnet test --environment="REDIS=172.0.0.1:6379" --environment="NUM_REDIS_CLUSTER_NODES=6" --no-build --verbosity normal dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] From 41a4c59a7bebdd6071f67654fb1da2f8af8f32d4 Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Thu, 21 Dec 2023 14:45:09 +0200 Subject: [PATCH 06/44] change to 127 --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index c4e1cfd5..b8e3f6af 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -63,7 +63,7 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test --environment="REDIS=172.0.0.1:6379" --environment="NUM_REDIS_CLUSTER_NODES=6" --no-build --verbosity normal + run: dotnet test --environment="REDIS=127.0.0.1:6379" --environment="NUM_REDIS_CLUSTER_NODES=6" --no-build --verbosity normal dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] From be4dc047da91adc33e2bcb59f5431b25e206ee4b Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Mon, 25 Dec 2023 15:35:18 +0200 Subject: [PATCH 07/44] skip if enterprise - start --- .github/workflows/integration.yml | 1 + CONTRIBUTING.md | 2 +- tests/NRedisStack.Tests/RedisFixture.cs | 1 + tests/NRedisStack.Tests/Search/SearchTests.cs | 8 ++-- .../NRedisStack.Tests/SkipIfRedisAttribute.cs | 37 ++++++++++++++----- 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index b8e3f6af..e559eee6 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -36,6 +36,7 @@ jobs: - name: Build cluster env: + IS_REDIS_ENTERPRISE: 'true' IMAGE: redislabs/redis-internal:100.0.1-64402 RE_USERNAME: test@test.com RE_PASS: 12345 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c5e007b..b9ee6a1d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,7 +110,7 @@ dotnet test --environment="REDIS=<redisServer:port>" ``` e.g: ```bash -dotnet test --environment="REDIS=172.17.0.1:6379" +dotnet test --environment="REDIS=127.17.0.1:6379" ``` To run your tests against an oss cluster: diff --git a/tests/NRedisStack.Tests/RedisFixture.cs b/tests/NRedisStack.Tests/RedisFixture.cs index aca9ba67..5e48d4cc 100644 --- a/tests/NRedisStack.Tests/RedisFixture.cs +++ b/tests/NRedisStack.Tests/RedisFixture.cs @@ -10,6 +10,7 @@ public class RedisFixture : IDisposable string redisStandalone = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; string? redisCluster = Environment.GetEnvironmentVariable("REDIS_CLUSTER"); string? numRedisClusterNodesEnv = Environment.GetEnvironmentVariable("NUM_REDIS_CLUSTER_NODES"); + public bool isEnterprise = Environment.GetEnvironmentVariable("IS_REDIS_ENTERPRISE") == "true"; public bool isOSSCluster = false; public RedisFixture() diff --git a/tests/NRedisStack.Tests/Search/SearchTests.cs b/tests/NRedisStack.Tests/Search/SearchTests.cs index 685fc0a2..0ceaa06e 100644 --- a/tests/NRedisStack.Tests/Search/SearchTests.cs +++ b/tests/NRedisStack.Tests/Search/SearchTests.cs @@ -825,7 +825,7 @@ public async Task AlterAddAsync() Assert.Equal(4, info.CursorStats.Count); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -836,7 +836,7 @@ public void TestConfig() Assert.Equal("100", configMap["TIMEOUT"].ToString()); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestConfigAsnyc() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1351,7 +1351,7 @@ public async Task TestExplainAsync() Assert.False(res.Length == 0); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestExplainCli() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1374,7 +1374,7 @@ public void TestExplainCli() Assert.False(res.Length == 0); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestExplainCliAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/SkipIfRedisAttribute.cs b/tests/NRedisStack.Tests/SkipIfRedisAttribute.cs index 856c9bca..ca9c6c22 100644 --- a/tests/NRedisStack.Tests/SkipIfRedisAttribute.cs +++ b/tests/NRedisStack.Tests/SkipIfRedisAttribute.cs @@ -10,7 +10,8 @@ public enum Comparison public enum Is { Standalone, - OSSCluster + OSSCluster, + Enterprise } [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] @@ -18,15 +19,28 @@ public class SkipIfRedisAttribute : FactAttribute { private readonly string _targetVersion; private readonly Comparison _comparison; - private readonly Is? _is = null; + private readonly List<Is> _environments = new List<Is>(); private readonly string DefaultRedisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; public SkipIfRedisAttribute( - Is _is, + Is environment, Comparison comparison = Comparison.LessThan, string targetVersion = "0.0.0") { - this._is = _is; + _environments.Add(environment); + _comparison = comparison; + _targetVersion = targetVersion; + } + + // skip more than one environment: + public SkipIfRedisAttribute( + Is environment1, + Is environment2, + Comparison comparison = Comparison.LessThan, + string targetVersion = "0.0.0") + { + _environments.Add(environment1); + _environments.Add(environment2); _comparison = comparison; _targetVersion = targetVersion; } @@ -51,11 +65,9 @@ public override string? Skip bool skipped = false; using (RedisFixture redisFixture = new RedisFixture()) { - - // Cluster check - if (_is != null) + foreach (var environment in _environments) { - switch (_is) + switch (environment) { case Is.OSSCluster: if (redisFixture.isOSSCluster) @@ -66,13 +78,20 @@ public override string? Skip break; case Is.Standalone: - if (!redisFixture.isOSSCluster) { skipReason = skipReason + " Redis server is not OSS cluster."; skipped = true; } break; + + case Is.Enterprise: + if (redisFixture.isEnterprise) + { + skipReason = skipReason + " Redis Enterprise environment."; + skipped = true; + } + break; } } // Version check (if Is.Standalone/Is.OSSCluster is set then ) From 276e2eedcc7792e1d9af5f859d777a3be4fa37dd Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Mon, 25 Dec 2023 15:46:20 +0200 Subject: [PATCH 08/44] change IS_REDIS_ENTERPRISE: 'true' location --- .github/workflows/integration.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e559eee6..4e8235f2 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -18,6 +18,8 @@ concurrency: jobs: NRedisStack-Enterprise-Test: name: NRedisStack Enterprise Test + env: + IS_REDIS_ENTERPRISE: 'true' runs-on: ubuntu-latest strategy: @@ -36,7 +38,6 @@ jobs: - name: Build cluster env: - IS_REDIS_ENTERPRISE: 'true' IMAGE: redislabs/redis-internal:100.0.1-64402 RE_USERNAME: test@test.com RE_PASS: 12345 From 2ef64b25ce77fb88bb54f554046d8b0fbb93732c Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Mon, 25 Dec 2023 16:08:02 +0200 Subject: [PATCH 09/44] skip gears in enterprise --- tests/NRedisStack.Tests/Gears/GearsTests.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/NRedisStack.Tests/Gears/GearsTests.cs b/tests/NRedisStack.Tests/Gears/GearsTests.cs index e4c5e7bb..1d867047 100644 --- a/tests/NRedisStack.Tests/Gears/GearsTests.cs +++ b/tests/NRedisStack.Tests/Gears/GearsTests.cs @@ -8,7 +8,7 @@ public class GearsTests : AbstractNRedisStackTest, IDisposable // private readonly string key = "GEARS_TESTS"; public GearsTests(RedisFixture redisFixture) : base(redisFixture) { } - [SkipIfRedis(Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] public void TestTFunctionLoadDelete() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -19,7 +19,7 @@ public void TestTFunctionLoadDelete() } - [SkipIfRedis(Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] public async Task TestTFunctionLoadDeleteAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -31,7 +31,7 @@ public async Task TestTFunctionLoadDeleteAsync() Assert.True(await db.TFunctionDeleteAsync("lib")); } - [SkipIfRedis(Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] public void TestTFunctionList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -63,7 +63,7 @@ public void TestTFunctionList() Assert.True(db.TFunctionDelete("lib3")); } - [SkipIfRedis(Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] public async Task TestTFunctionListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -93,7 +93,7 @@ public async Task TestTFunctionListAsync() Assert.True(await db.TFunctionDeleteAsync("lib3")); } - [SkipIfRedis(Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] public void TestTFCall() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -108,7 +108,7 @@ public void TestTFCall() Assert.True(db.TFunctionDelete("lib")); } - [SkipIfRedis(Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] public async Task TestTFCallAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -123,7 +123,7 @@ public async Task TestTFCallAsync() Assert.True(await db.TFunctionDeleteAsync("lib")); } - [SkipIfRedis(Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] public void TestGearsCommandBuilder() { // TFunctionLoad: From 940cc8c82e64eed05b45c5e30e9eef57a1b3cefb Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Mon, 25 Dec 2023 16:15:05 +0200 Subject: [PATCH 10/44] skip tests with ft.config --- tests/NRedisStack.Tests/Search/SearchTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/NRedisStack.Tests/Search/SearchTests.cs b/tests/NRedisStack.Tests/Search/SearchTests.cs index 0ceaa06e..8a465f57 100644 --- a/tests/NRedisStack.Tests/Search/SearchTests.cs +++ b/tests/NRedisStack.Tests/Search/SearchTests.cs @@ -847,7 +847,7 @@ public async Task TestConfigAsnyc() Assert.Equal("100", configMap["TIMEOUT"].ToString()); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void configOnTimeout() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -859,7 +859,7 @@ public void configOnTimeout() try { ft.ConfigSet("ON_TIMEOUT", "null"); } catch (RedisServerException) { } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task configOnTimeoutAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -871,7 +871,7 @@ public async Task configOnTimeoutAsync() try { ft.ConfigSet("ON_TIMEOUT", "null"); } catch (RedisServerException) { } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestDialectConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -893,7 +893,7 @@ public void TestDialectConfig() Assert.True(ft.ConfigSet("DEFAULT_DIALECT", "1")); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestDialectConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); From 5fb1b1807a2dbec3538ec1f8f565d1d4abc9f39d Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Mon, 25 Dec 2023 16:35:33 +0200 Subject: [PATCH 11/44] dont send REDISGEARS_2.REFRESHCLUSTER if enterprise --- tests/NRedisStack.Tests/Gears/GearsTests.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/NRedisStack.Tests/Gears/GearsTests.cs b/tests/NRedisStack.Tests/Gears/GearsTests.cs index 1d867047..02a7c474 100644 --- a/tests/NRedisStack.Tests/Gears/GearsTests.cs +++ b/tests/NRedisStack.Tests/Gears/GearsTests.cs @@ -12,7 +12,8 @@ public GearsTests(RedisFixture redisFixture) : base(redisFixture) { } public void TestTFunctionLoadDelete() { IDatabase db = redisFixture.Redis.GetDatabase(); - db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); + if (!redisFixture.isEnterprise) + db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); db.Execute("FLUSHALL"); Assert.True(db.TFunctionLoad(GenerateLibCode("lib"))); Assert.True(db.TFunctionDelete("lib")); @@ -23,7 +24,8 @@ public void TestTFunctionLoadDelete() public async Task TestTFunctionLoadDeleteAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); - db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); + if (!redisFixture.isEnterprise) + db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); db.Execute("FLUSHALL"); TryDeleteLib(db, "lib", "lib1", "lib2", "lib3"); @@ -35,7 +37,8 @@ public async Task TestTFunctionLoadDeleteAsync() public void TestTFunctionList() { IDatabase db = redisFixture.Redis.GetDatabase(); - db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); + if (!redisFixture.isEnterprise) + db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); db.Execute("FLUSHALL"); TryDeleteLib(db, "lib", "lib1", "lib2", "lib3"); @@ -67,7 +70,8 @@ public void TestTFunctionList() public async Task TestTFunctionListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); - db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); + if (!redisFixture.isEnterprise) + db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); db.Execute("FLUSHALL"); TryDeleteLib(db, "lib", "lib1", "lib2", "lib3"); @@ -97,7 +101,8 @@ public async Task TestTFunctionListAsync() public void TestTFCall() { IDatabase db = redisFixture.Redis.GetDatabase(); - db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); + if (!redisFixture.isEnterprise) + db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); db.Execute("FLUSHALL"); TryDeleteLib(db, "lib", "lib1", "lib2", "lib3"); @@ -112,7 +117,8 @@ public void TestTFCall() public async Task TestTFCallAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); - db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); + if (!redisFixture.isEnterprise) + db.ExecuteBroadcast("REDISGEARS_2.REFRESHCLUSTER"); db.Execute("FLUSHALL"); TryDeleteLib(db, "lib", "lib1", "lib2", "lib3"); From 158019dca47ffeb5ce83897daf1b7466cc179beb Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Mon, 25 Dec 2023 16:57:53 +0200 Subject: [PATCH 12/44] skip unknown command test --- tests/NRedisStack.Tests/Examples/ExampleTests.cs | 2 +- tests/NRedisStack.Tests/TransactionsTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/NRedisStack.Tests/Examples/ExampleTests.cs b/tests/NRedisStack.Tests/Examples/ExampleTests.cs index adc5636f..527981b9 100644 --- a/tests/NRedisStack.Tests/Examples/ExampleTests.cs +++ b/tests/NRedisStack.Tests/Examples/ExampleTests.cs @@ -229,7 +229,7 @@ public async Task PipelineWithAsync() Assert.Equal("temp:JLM", respons[0].key); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TransactionExample() { // Connect to the Redis server diff --git a/tests/NRedisStack.Tests/TransactionsTests.cs b/tests/NRedisStack.Tests/TransactionsTests.cs index b811acf8..498ed77c 100644 --- a/tests/NRedisStack.Tests/TransactionsTests.cs +++ b/tests/NRedisStack.Tests/TransactionsTests.cs @@ -83,7 +83,7 @@ public void TestModulsTransaction() Assert.NotNull(db.TOPK().Info("topk-key")); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] [Obsolete] public void TestModulsTransactionWithoutGraph() { From 08b87bf36ee2df208c0893ca8845e2e9d153003d Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Mon, 25 Dec 2023 17:09:24 +0200 Subject: [PATCH 13/44] chayim --- .github/workflows/integration.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4e8235f2..f6c91363 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -24,6 +24,8 @@ jobs: strategy: fail-fast: false + matrix: + oss-cluster: ['true', 'false'] steps: - name: Clone Redis EE docker repository @@ -65,8 +67,13 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test + if: ${{matrix.oss_cluster}} == 'false' run: dotnet test --environment="REDIS=127.0.0.1:6379" --environment="NUM_REDIS_CLUSTER_NODES=6" --no-build --verbosity normal + - name: Test + if: ${{matrix.oss_cluster}} == 'true' + run: dotnet test --environment="REDIS=127.0.0.1:6379" --no-build --verbosity normal + dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] uses: ./.github/workflows/reusable.yml From de17cab9d6cbf105c12f90268970555695773793 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Tue, 26 Dec 2023 14:55:02 +0200 Subject: [PATCH 14/44] add oss-cluetr as another job --- .github/workflows/integration.yml | 56 +++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index f6c91363..84d96b9e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -24,8 +24,6 @@ jobs: strategy: fail-fast: false - matrix: - oss-cluster: ['true', 'false'] steps: - name: Clone Redis EE docker repository @@ -67,12 +65,58 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - if: ${{matrix.oss_cluster}} == 'false' - run: dotnet test --environment="REDIS=127.0.0.1:6379" --environment="NUM_REDIS_CLUSTER_NODES=6" --no-build --verbosity normal + run: dotnet test --environment="REDIS=127.0.0.1:6379" --no-build --verbosity normal + + NRedisStack-Enterprise-Test-OssCluster: + name: NRedisStack Enterprise Test - OSS Cluster + env: + IS_REDIS_ENTERPRISE: 'true' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + steps: + - name: Clone Redis EE docker repository + run: | + git clone https://github.com/RedisLabs/redis-ee-docker.git redis-ee + + - name: Install Docker-compose + run: | + DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + mkdir -p $DOCKER_CONFIG/cli-plugins + curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + + - name: Build cluster + env: + IMAGE: redislabs/redis-internal:100.0.1-64402 + RE_USERNAME: test@test.com + RE_PASS: 12345 + RE_CLUSTER_NAME: test + OSS_CLUSTER: true + DB_PORT: 6378 + DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + run: | + cd redis-ee/ + ./build.sh + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: .NET Core 7 + uses: actions/setup-dotnet@v2 + + with: + dotnet-version: '7.0.x' + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - if: ${{matrix.oss_cluster}} == 'true' - run: dotnet test --environment="REDIS=127.0.0.1:6379" --no-build --verbosity normal + run: dotnet test --environment="REDIS=127.0.0.1:6372" --environment="NUM_REDIS_CLUSTER_NODES=6" --no-build --verbosity normal dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] From 32a9d1818faf51496a7085ae5d108696dbf37679 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Tue, 26 Dec 2023 17:24:53 +0200 Subject: [PATCH 15/44] try add standalone host+port at the start of endpoints --- .github/workflows/integration.yml | 2 +- tests/NRedisStack.Tests/RedisFixture.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 84d96b9e..5fa7ddf3 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -116,7 +116,7 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test --environment="REDIS=127.0.0.1:6372" --environment="NUM_REDIS_CLUSTER_NODES=6" --no-build --verbosity normal + run: dotnet test --environment="REDIS=127.0.0.1:6378" --environment="REDIS_CLUSTER=127.0.0.1:6372" --environment="NUM_REDIS_CLUSTER_NODES=6" --no-build --verbosity normal dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] diff --git a/tests/NRedisStack.Tests/RedisFixture.cs b/tests/NRedisStack.Tests/RedisFixture.cs index 5e48d4cc..4e50d15b 100644 --- a/tests/NRedisStack.Tests/RedisFixture.cs +++ b/tests/NRedisStack.Tests/RedisFixture.cs @@ -24,6 +24,9 @@ public RedisFixture() int startPort = int.Parse(parts[1]); var endpoints = new EndPointCollection(); + if (redisStandalone != null) + endpoints.Add(redisStandalone); + int numRedisClusterNodes = int.Parse(numRedisClusterNodesEnv!); for (int i = 0; i < numRedisClusterNodes; i++) { From 11a3c45702b2cb7b75eb9b40cbe907deba9ef9d7 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Tue, 26 Dec 2023 17:39:49 +0200 Subject: [PATCH 16/44] fix dotnet test and change the nodes to 3 --- .github/workflows/integration.yml | 2 +- tests/NRedisStack.Tests/RedisFixture.cs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 5fa7ddf3..3717eb60 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -116,7 +116,7 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test --environment="REDIS=127.0.0.1:6378" --environment="REDIS_CLUSTER=127.0.0.1:6372" --environment="NUM_REDIS_CLUSTER_NODES=6" --no-build --verbosity normal + run: dotnet test --environment="REDIS_CLUSTER=127.0.0.1:6372" --environment="NUM_REDIS_CLUSTER_NODES=3" --no-build --verbosity normal dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] diff --git a/tests/NRedisStack.Tests/RedisFixture.cs b/tests/NRedisStack.Tests/RedisFixture.cs index 4e50d15b..f3b8fb79 100644 --- a/tests/NRedisStack.Tests/RedisFixture.cs +++ b/tests/NRedisStack.Tests/RedisFixture.cs @@ -24,8 +24,6 @@ public RedisFixture() int startPort = int.Parse(parts[1]); var endpoints = new EndPointCollection(); - if (redisStandalone != null) - endpoints.Add(redisStandalone); int numRedisClusterNodes = int.Parse(numRedisClusterNodesEnv!); for (int i = 0; i < numRedisClusterNodes; i++) From 09569c5769edd46d827dd3fffcbec14dd731dd14 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Thu, 28 Dec 2023 14:23:42 +0200 Subject: [PATCH 17/44] start skipping --- .../Examples/ExampleTests.cs | 2 +- tests/NRedisStack.Tests/Json/JsonTests.cs | 88 +++++++++---------- .../TimeSeries/TestAPI/TestMGet.cs | 6 +- .../TimeSeries/TestAPI/TestMGetAsync.cs | 6 +- .../TimeSeries/TestAPI/TestRange.cs | 4 +- .../TimeSeries/TestAPI/TestRangeAsync.cs | 4 +- .../TimeSeries/TestAPI/TestRevRange.cs | 12 +-- .../TimeSeries/TestAPI/TestRevRangeAsync.cs | 12 +-- .../TimeSeries/TestAPI/TestRules.cs | 4 +- .../TimeSeries/TestAPI/TestRulesAsync.cs | 8 +- 10 files changed, 73 insertions(+), 73 deletions(-) diff --git a/tests/NRedisStack.Tests/Examples/ExampleTests.cs b/tests/NRedisStack.Tests/Examples/ExampleTests.cs index 527981b9..1082fb0d 100644 --- a/tests/NRedisStack.Tests/Examples/ExampleTests.cs +++ b/tests/NRedisStack.Tests/Examples/ExampleTests.cs @@ -171,7 +171,7 @@ public async Task JsonWithSearchPipeline() // Assert.Equal("person:01", firstPerson?.Id); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task PipelineWithAsync() { // Connect to the Redis server diff --git a/tests/NRedisStack.Tests/Json/JsonTests.cs b/tests/NRedisStack.Tests/Json/JsonTests.cs index 052fb836..34994588 100644 --- a/tests/NRedisStack.Tests/Json/JsonTests.cs +++ b/tests/NRedisStack.Tests/Json/JsonTests.cs @@ -731,7 +731,7 @@ public async Task GetAsync() Assert.Equal(35, people[1]!.Age); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public void MSet() { var commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -755,7 +755,7 @@ public void MSet() Assert.Throws<ArgumentOutOfRangeException>(() => commands.MSet(new KeyPathValue[0])); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public async Task MSetAsync() { var commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -816,7 +816,7 @@ public async Task MergeAsync() Assert.Equal("{\"person\":{\"name\":\"John Doe\",\"phone\":\"123-456-7890\",\"address\":{\"home\":\"123 Main Street\",\"work\":\"Redis office\"}}}", (await commands.GetAsync("test_merge")).ToString()); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void MGet() { var commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -831,7 +831,7 @@ public void MGet() Assert.Equal("[\"world\"]", result[1].ToString()); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task MGetAsync() { var commands = new JsonCommandsAsync(redisFixture.Redis.GetDatabase()); @@ -1154,80 +1154,80 @@ public async Task TestGetIssue198_Async() } [Fact] - public void TestSetWithSerializationOptions() - { - var commands = new JsonCommands(redisFixture.Redis.GetDatabase()); + public void TestSetWithSerializationOptions() + { + var commands = new JsonCommands(redisFixture.Redis.GetDatabase()); var keys = CreateKeyNames(1); - var key = keys[0]; - var jsonOptions = new JsonSerializerOptions { IncludeFields = true }; + var key = keys[0]; + var jsonOptions = new JsonSerializerOptions { IncludeFields = true }; var person = new Person { Name = "Developer", Age = 23, Birthday = DateTime.Today }; - commands.Set(key, "$", person, serializerOptions: jsonOptions); + commands.Set(key, "$", person, serializerOptions: jsonOptions); Person? result = commands.Get<Person>(key, serializerOptions: jsonOptions); - Assert.NotNull(result); - Assert.Equal(person.Name, result!.Name); - Assert.Equal(person.Age, result!.Age); - Assert.NotNull(result!.Birthday); - Assert.Equal(person.Birthday, result!.Birthday); + Assert.NotNull(result); + Assert.Equal(person.Name, result!.Name); + Assert.Equal(person.Age, result!.Age); + Assert.NotNull(result!.Birthday); + Assert.Equal(person.Birthday, result!.Birthday); } [Fact] - public async Task TestSetWithSerializationOptionsAsync() - { - var commands = new JsonCommands(redisFixture.Redis.GetDatabase()); + public async Task TestSetWithSerializationOptionsAsync() + { + var commands = new JsonCommands(redisFixture.Redis.GetDatabase()); var keys = CreateKeyNames(1); - var key = keys[0]; - var jsonOptions = new JsonSerializerOptions { IncludeFields = true }; - var person = new Person { Name = "Developer", Age = 23, Birthday = DateTime.Today }; - - await commands.SetAsync(key, "$", person, serializerOptions: jsonOptions); + var key = keys[0]; + var jsonOptions = new JsonSerializerOptions { IncludeFields = true }; + var person = new Person { Name = "Developer", Age = 23, Birthday = DateTime.Today }; + + await commands.SetAsync(key, "$", person, serializerOptions: jsonOptions); Person? result = await commands.GetAsync<Person>(key, serializerOptions: jsonOptions); - Assert.NotNull(result); - Assert.Equal(person.Name, result!.Name); - Assert.Equal(person.Age, result!.Age); - Assert.NotNull(result!.Birthday); - Assert.Equal(person.Birthday, result!.Birthday); + Assert.NotNull(result); + Assert.Equal(person.Name, result!.Name); + Assert.Equal(person.Age, result!.Age); + Assert.NotNull(result!.Birthday); + Assert.Equal(person.Birthday, result!.Birthday); } [SkipIfRedis("7.1.242")] - public void MergeWithSerializationOptions() - { + public void MergeWithSerializationOptions() + { string expected = "{\"age\":23,\"birthday\":\"2023-12-31T00:00:00\",\"name\":\"Developer\"}"; var commands = new JsonCommands(redisFixture.Redis.GetDatabase()); var keys = CreateKeyNames(1); - var key = keys[0]; + var key = keys[0]; commands.Set(key, "$", new { age = 5, birthday = new DateTime(2000, 1, 1) }); var jsonOptions = new JsonSerializerOptions { IncludeFields = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; var person = new Person { Name = "Developer", Age = 23, Birthday = new DateTime(2023, 12, 31) }; - commands.Merge(key, "$", person, serializerOptions: jsonOptions); - RedisResult rr = commands.Get(key); - - Assert.False(rr.IsNull); - string actual = rr.ToString()!; + commands.Merge(key, "$", person, serializerOptions: jsonOptions); + RedisResult rr = commands.Get(key); + + Assert.False(rr.IsNull); + string actual = rr.ToString()!; Assert.Equal(expected, actual); } [SkipIfRedis("7.1.242")] - public async Task MergeWithSerializationOptionsAsync() - { + public async Task MergeWithSerializationOptionsAsync() + { string expected = "{\"age\":23,\"birthday\":\"2023-12-31T00:00:00\",\"name\":\"Developer\"}"; var commands = new JsonCommands(redisFixture.Redis.GetDatabase()); var keys = CreateKeyNames(1); - var key = keys[0]; + var key = keys[0]; await commands.SetAsync(key, "$", new { age = 5, birthday = new DateTime(2000, 1, 1) }); var jsonOptions = new JsonSerializerOptions { IncludeFields = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; var person = new Person { Name = "Developer", Age = 23, Birthday = new DateTime(2023, 12, 31) }; - await commands.MergeAsync(key, "$", person, serializerOptions: jsonOptions); - RedisResult rr = await commands.GetAsync(key); - - Assert.False(rr.IsNull); - string actual = rr.ToString()!; + await commands.MergeAsync(key, "$", person, serializerOptions: jsonOptions); + RedisResult rr = await commands.GetAsync(key); + + Assert.False(rr.IsNull); + string actual = rr.ToString()!; Assert.Equal(expected, actual); } } \ No newline at end of file diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGet.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGet.cs index ae313418..132a1e6f 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGet.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGet.cs @@ -12,7 +12,7 @@ public class TestMGet : AbstractNRedisStackTest, IDisposable public TestMGet(RedisFixture redisFixture) : base(redisFixture) { } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster,Is.Enterprise)] public void TestMGetQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -39,7 +39,7 @@ public void TestMGetQuery() } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMGetQueryWithLabels() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -66,7 +66,7 @@ public void TestMGetQueryWithLabels() Assert.Equal(labels2, results[1].labels); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMGetQuerySelectedLabels() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGetAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGetAsync.cs index 4fe94e37..fb3ce257 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGetAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGetAsync.cs @@ -8,7 +8,7 @@ public class TestMGetAsync : AbstractNRedisStackTest { public TestMGetAsync(RedisFixture redisFixture) : base(redisFixture) { } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMGetQuery() { var keys = CreateKeyNames(2); @@ -36,7 +36,7 @@ public async Task TestMGetQuery() Assert.Equal(new List<TimeSeriesLabel>(), results[1].labels); } - [Fact] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMGetQueryWithLabels() { var keys = CreateKeyNames(2); @@ -64,7 +64,7 @@ public async Task TestMGetQueryWithLabels() Assert.Equal(labels2, results[1].labels); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMGetQuerySelectedLabelsAsync() { var keys = CreateKeyNames(2); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRange.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRange.cs index 342f6fb2..00bda2b4 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRange.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRange.cs @@ -126,7 +126,7 @@ public void TestFilterBy() Assert.Equal(tuples.GetRange(2, 1), res); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void latest() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -161,7 +161,7 @@ public void latest() Assert.Equal(new List<TimeSeriesTuple>() { latest, compact }, ts.RevRange("ts2", 0, 10, true)); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestAlignTimestamp() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRangeAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRangeAsync.cs index 186bb25b..ab9aba4d 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRangeAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRangeAsync.cs @@ -129,7 +129,7 @@ public async Task TestFilterBy() Assert.Equal(tuples.GetRange(2, 1), res); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestLatestAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -164,7 +164,7 @@ public async Task TestLatestAsync() Assert.Equal(new List<TimeSeriesTuple>() { latest, compact }, await ts.RevRangeAsync("ts2", 0, 10, true)); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestAlignTimestampAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRevRange.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRevRange.cs index e9e0cbcd..bff63d04 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRevRange.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRevRange.cs @@ -20,7 +20,7 @@ private List<TimeSeriesTuple> CreateData(ITimeSeriesCommands ts, string key, int return tuples; } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestSimpleRevRange() { var key = CreateKeyName(); @@ -31,7 +31,7 @@ public void TestSimpleRevRange() Assert.Equal(ReverseData(tuples), ts.RevRange(key, "-", "+")); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestRevRangeCount() { var key = CreateKeyName(); @@ -42,7 +42,7 @@ public void TestRevRangeCount() Assert.Equal(ReverseData(tuples).GetRange(0, 5), ts.RevRange(key, "-", "+", count: 5)); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestRevRangeAggregation() { var key = CreateKeyName(); @@ -53,7 +53,7 @@ public void TestRevRangeAggregation() Assert.Equal(ReverseData(tuples), ts.RevRange(key, "-", "+", aggregation: TsAggregation.Min, timeBucket: 50)); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestRevRangeAlign() { var key = CreateKeyName(); @@ -95,7 +95,7 @@ public void TestRevRangeAlign() Assert.Equal(resStart, ts.RevRange(key, 1, 30, align: 1, aggregation: TsAggregation.Count, timeBucket: 10)); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestMissingTimeBucket() { var key = CreateKeyName(); @@ -108,7 +108,7 @@ public void TestMissingTimeBucket() } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestFilterBy() { var key = CreateKeyName(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRevRangeAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRevRangeAsync.cs index 873e06d0..98703e04 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRevRangeAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRevRangeAsync.cs @@ -21,7 +21,7 @@ private async Task<List<TimeSeriesTuple>> CreateData(TimeSeriesCommands ts, stri return tuples; } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestSimpleRevRange() { var key = CreateKeyName(); @@ -32,7 +32,7 @@ public async Task TestSimpleRevRange() Assert.Equal(ReverseData(tuples), await ts.RevRangeAsync(key, "-", "+")); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestRevRangeCount() { var key = CreateKeyName(); @@ -43,7 +43,7 @@ public async Task TestRevRangeCount() Assert.Equal(ReverseData(tuples).GetRange(0, 5), await ts.RevRangeAsync(key, "-", "+", count: 5)); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestRevRangeAggregation() { var key = CreateKeyName(); @@ -54,7 +54,7 @@ public async Task TestRevRangeAggregation() Assert.Equal(ReverseData(tuples), await ts.RevRangeAsync(key, "-", "+", aggregation: TsAggregation.Min, timeBucket: 50)); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestRevRangeAlign() { var key = CreateKeyName(); @@ -96,7 +96,7 @@ public async Task TestRevRangeAlign() Assert.Equal(resStart, await ts.RevRangeAsync(key, 1, 30, align: 1, aggregation: TsAggregation.Count, timeBucket: 10)); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestMissingTimeBucket() { var key = CreateKeyName(); @@ -108,7 +108,7 @@ public async Task TestMissingTimeBucket() Assert.Equal("RANGE Aggregation should have timeBucket value", ex.Message); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestFilterBy() { var key = CreateKeyName(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRules.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRules.cs index 82ff0183..5fab3c9a 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRules.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRules.cs @@ -32,7 +32,7 @@ public TestRules(RedisFixture redisFixture) : base(redisFixture) }; } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] [Obsolete] public void TestRulesAdditionDeletion() { @@ -96,7 +96,7 @@ public void TestNonExisitingDestinaion() Assert.Equal("ERR TSDB: compaction rule does not exist", ex.Message); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestAlignTimestamp() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRulesAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRulesAsync.cs index b7cb6455..3724d139 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRulesAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRulesAsync.cs @@ -10,7 +10,7 @@ public class TestRulesAsync : AbstractNRedisStackTest { public TestRulesAsync(RedisFixture redisFixture) : base(redisFixture) { } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] [Obsolete] public async Task TestRulesAdditionDeletion() { @@ -53,7 +53,7 @@ public async Task TestRulesAdditionDeletion() await db.KeyDeleteAsync(aggregations.Select(i => (RedisKey)$"{key}:{i}").ToArray()); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestNonExistingSrc() { var key = CreateKeyName(); @@ -72,7 +72,7 @@ public async Task TestNonExistingSrc() await db.KeyDeleteAsync(aggKey); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestNonExisitingDestinaion() { var key = CreateKeyName(); @@ -89,7 +89,7 @@ public async Task TestNonExisitingDestinaion() Assert.Equal("ERR TSDB: compaction rule does not exist", ex.Message); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestAlignTimestampAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); From 766a44c8a93bd2fc201ba5f1464569f5b88aceb1 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Thu, 28 Dec 2023 15:02:13 +0200 Subject: [PATCH 18/44] try chayim changes --- .github/workflows/integration.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3717eb60..475922f6 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -42,8 +42,8 @@ jobs: RE_USERNAME: test@test.com RE_PASS: 12345 RE_CLUSTER_NAME: test - OSS_CLUSTER: false - DB_PORT: 6379 + RE_USE_OSS_CLUSTER: false + RE_DB_PORT: 6379 DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} run: | @@ -93,8 +93,8 @@ jobs: RE_USERNAME: test@test.com RE_PASS: 12345 RE_CLUSTER_NAME: test - OSS_CLUSTER: true - DB_PORT: 6378 + RE_USE_OSS_CLUSTER: true + RE_DB_PORT: 6378 DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} run: | From 7cafee390034e9f6376a36b0f074507470d2550c Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Thu, 28 Dec 2023 15:18:13 +0200 Subject: [PATCH 19/44] cahange 100.0.1-64402 to 7.2.4-92 + skip + return to previus env names --- .github/workflows/integration.yml | 12 +++++----- .../TimeSeries/TestAPI/TestMADD.cs | 6 ++--- .../TimeSeries/TestAPI/TestMAddAsync.cs | 6 ++--- .../TimeSeries/TestAPI/TestMRange.cs | 20 ++++++++-------- .../TimeSeries/TestAPI/TestMRangeAsync.cs | 24 +++++++++---------- .../TimeSeries/TestAPI/TestMRevRange.cs | 24 +++++++++---------- .../TimeSeries/TestAPI/TestMRevRangeAsync.cs | 24 +++++++++---------- 7 files changed, 58 insertions(+), 58 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 475922f6..d29e352c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -38,12 +38,12 @@ jobs: - name: Build cluster env: - IMAGE: redislabs/redis-internal:100.0.1-64402 + IMAGE: redislabs/redis-internal:7.2.4-92 RE_USERNAME: test@test.com RE_PASS: 12345 RE_CLUSTER_NAME: test - RE_USE_OSS_CLUSTER: false - RE_DB_PORT: 6379 + OSS_CLUSTER: false + DB_PORT: 6379 DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} run: | @@ -89,12 +89,12 @@ jobs: - name: Build cluster env: - IMAGE: redislabs/redis-internal:100.0.1-64402 + IMAGE: redislabs/redis-internal:7.2.4-92 RE_USERNAME: test@test.com RE_PASS: 12345 RE_CLUSTER_NAME: test - RE_USE_OSS_CLUSTER: true - RE_DB_PORT: 6378 + OSS_CLUSTER: true + DB_PORT: 6378 DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} run: | diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs index 4acf5547..07b0087e 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs @@ -13,7 +13,7 @@ public class TestMADD : AbstractNRedisStackTest, IDisposable public TestMADD(RedisFixture redisFixture) : base(redisFixture) { } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] [Obsolete] public void TestStarMADD() { @@ -43,7 +43,7 @@ public void TestStarMADD() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestSuccessfulMADD() { @@ -73,7 +73,7 @@ public void TestSuccessfulMADD() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestOverrideMADD() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs index 5bc4b04a..625fdf3a 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs @@ -11,7 +11,7 @@ public class TestMAddAsync : AbstractNRedisStackTest public TestMAddAsync(RedisFixture redisFixture) : base(redisFixture) { } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] [Obsolete] public async Task TestStarMADD() { @@ -44,7 +44,7 @@ public async Task TestStarMADD() } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestSuccessfulMAdd() { var keys = CreateKeyNames(2); @@ -74,7 +74,7 @@ public async Task TestSuccessfulMAdd() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestOverrideMAdd() { var keys = CreateKeyNames(2); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRange.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRange.cs index cbec11ba..11cc9488 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRange.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRange.cs @@ -28,7 +28,7 @@ private List<TimeSeriesTuple> CreateData(ITimeSeriesCommands ts, int timeBucket) return tuples; } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestSimpleMRange() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -51,7 +51,7 @@ public void TestSimpleMRange() Assert.Equal(tuples, results[i].values); } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeWithLabels() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -75,7 +75,7 @@ public void TestMRangeWithLabels() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeSelectLabels() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -104,7 +104,7 @@ public void TestMRangeSelectLabels() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeFilter() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -121,7 +121,7 @@ public void TestMRangeFilter() Assert.Equal(tuples, results[0].values); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeCount() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -146,7 +146,7 @@ public void TestMRangeCount() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeAggregation() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -170,7 +170,7 @@ public void TestMRangeAggregation() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeAlign() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -229,7 +229,7 @@ public void TestMissingTimeBucket() Assert.Equal("RANGE Aggregation should have timeBucket value", ex.Message); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeGroupby() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -255,7 +255,7 @@ public void TestMRangeGroupby() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeReduce() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -280,7 +280,7 @@ public void TestMRangeReduce() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeFilterBy() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRangeAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRangeAsync.cs index dd212aef..3f0c6899 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRangeAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRangeAsync.cs @@ -27,7 +27,7 @@ private async Task<List<TimeSeriesTuple>> CreateData(TimeSeriesCommands ts, stri return tuples; } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestSimpleMRange() { var keys = CreateKeyNames(2); @@ -51,7 +51,7 @@ public async Task TestSimpleMRange() Assert.Equal(tuples, results[i].values); } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeWithLabels() { var keys = CreateKeyNames(2); @@ -76,7 +76,7 @@ public async Task TestMRangeWithLabels() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeSelectLabels() { var keys = CreateKeyNames(2); @@ -110,7 +110,7 @@ await ts.MRangeAsync("-", "+", } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeFilter() { var keys = CreateKeyNames(2); @@ -128,7 +128,7 @@ public async Task TestMRangeFilter() Assert.Equal(tuples, results[0].values); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeCount() { var keys = CreateKeyNames(2); @@ -154,7 +154,7 @@ public async Task TestMRangeCount() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeAggregation() { var keys = CreateKeyNames(2); @@ -179,7 +179,7 @@ public async Task TestMRangeAggregation() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeAlign() { var keys = CreateKeyNames(2); @@ -203,7 +203,7 @@ public async Task TestMRangeAlign() Assert.Equal(expected[0], results[0].values[0]); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMissingFilter() { var keys = CreateKeyNames(2); @@ -222,7 +222,7 @@ public async Task TestMissingFilter() Assert.Equal("There should be at least one filter on MRANGE/MREVRANGE", ex.Message); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMissingTimeBucket() { var keys = CreateKeyNames(2); @@ -245,7 +245,7 @@ await ts.MRangeAsync("-", "+", }); Assert.Equal("RANGE Aggregation should have timeBucket value", ex.Message); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeGroupby() { var keys = CreateKeyNames(2); @@ -272,7 +272,7 @@ public async Task TestMRangeGroupby() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeReduce() { var keys = CreateKeyNames(2); @@ -298,7 +298,7 @@ public async Task TestMRangeReduce() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeFilterBy() { var keys = CreateKeyNames(2); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRevRange.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRevRange.cs index aa3a76fd..4399ac18 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRevRange.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRevRange.cs @@ -27,7 +27,7 @@ private List<TimeSeriesTuple> CreateData(ITimeSeriesCommands ts, string[] keys, return tuples; } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestSimpleMRevRange() { var keys = CreateKeyNames(2); @@ -52,7 +52,7 @@ public void TestSimpleMRevRange() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRevRangeWithLabels() { var keys = CreateKeyNames(2); @@ -78,7 +78,7 @@ public void TestMRevRangeWithLabels() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRevRangeSelectLabels() { var keys = CreateKeyNames(2); @@ -103,7 +103,7 @@ public void TestMRevRangeSelectLabels() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRevRangeFilter() { var keys = CreateKeyNames(2); @@ -121,7 +121,7 @@ public void TestMRevRangeFilter() Assert.Equal(ReverseData(tuples), results[0].values); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRevRangeCount() { var keys = CreateKeyNames(2); @@ -147,7 +147,7 @@ public void TestMRevRangeCount() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRevRangeAggregation() { var keys = CreateKeyNames(2); @@ -172,7 +172,7 @@ public void TestMRevRangeAggregation() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRevRangeAlign() { var keys = CreateKeyNames(2); @@ -196,7 +196,7 @@ public void TestMRevRangeAlign() Assert.Equal(expected[0], results[0].values[0]); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMissingFilter() { var keys = CreateKeyNames(2); @@ -215,7 +215,7 @@ public void TestMissingFilter() Assert.Equal("There should be at least one filter on MRANGE/MREVRANGE", ex.Message); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMissingTimeBucket() { var keys = CreateKeyNames(2); @@ -234,7 +234,7 @@ public void TestMissingTimeBucket() Assert.Equal("RANGE Aggregation should have timeBucket value", ex.Message); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRevRangeGroupby() { var keys = CreateKeyNames(2); @@ -261,7 +261,7 @@ public void TestMRevRangeGroupby() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRevRangeReduce() { var keys = CreateKeyNames(2); @@ -288,7 +288,7 @@ public void TestMRevRangeReduce() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRevRangeFilterBy() { var keys = CreateKeyNames(2); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRevRangeAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRevRangeAsync.cs index 34a4c554..d2327c11 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRevRangeAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRevRangeAsync.cs @@ -27,7 +27,7 @@ private async Task<List<TimeSeriesTuple>> CreateData(TimeSeriesCommands ts, stri return tuples; } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestSimpleMRevRange() { var keys = CreateKeyNames(2); @@ -52,7 +52,7 @@ public async Task TestSimpleMRevRange() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRevRangeWithLabels() { var keys = CreateKeyNames(2); @@ -77,7 +77,7 @@ public async Task TestMRevRangeWithLabels() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRevRangeSelectLabels() { var keys = CreateKeyNames(2); @@ -102,7 +102,7 @@ public async Task TestMRevRangeSelectLabels() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRevRangeFilter() { var keys = CreateKeyNames(2); @@ -120,7 +120,7 @@ public async Task TestMRevRangeFilter() Assert.Equal(ReverseData(tuples), results[0].values); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRevRangeCount() { var keys = CreateKeyNames(2); @@ -146,7 +146,7 @@ public async Task TestMRevRangeCount() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRangeAggregation() { var keys = CreateKeyNames(2); @@ -171,7 +171,7 @@ public async Task TestMRangeAggregation() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRevRangeAlign() { var keys = CreateKeyNames(2); @@ -195,7 +195,7 @@ public async Task TestMRevRangeAlign() Assert.Equal(expected[0], results[0].values[0]); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMissingFilter() { var keys = CreateKeyNames(2); @@ -214,7 +214,7 @@ public async Task TestMissingFilter() Assert.Equal("There should be at least one filter on MRANGE/MREVRANGE", ex.Message); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMissingTimeBucket() { var keys = CreateKeyNames(2); @@ -238,7 +238,7 @@ await ts.MRevRangeAsync("-", "+", Assert.Equal("RANGE Aggregation should have timeBucket value", ex.Message); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRevRangeGroupby() { var keys = CreateKeyNames(2); @@ -265,7 +265,7 @@ public async Task TestMRevRangeGroupby() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRevRangeReduce() { var keys = CreateKeyNames(2); @@ -292,7 +292,7 @@ public async Task TestMRevRangeReduce() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMRevRangeFilterBy() { var keys = CreateKeyNames(2); From 4b515b4f51477151780030e9d9f7c0086df68ad8 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Thu, 28 Dec 2023 16:14:20 +0200 Subject: [PATCH 20/44] skips --- .../CountMinSketch/CmsTests.cs | 4 ++-- tests/NRedisStack.Tests/Search/SearchTests.cs | 18 +++++++++--------- .../NRedisStack.Tests/Tdigest/TdigestTests.cs | 8 ++++---- .../TimeSeries/TestAPI/TestQueryIndex.cs | 2 +- .../TimeSeries/TestAPI/TestQueryIndexAsync.cs | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/NRedisStack.Tests/CountMinSketch/CmsTests.cs b/tests/NRedisStack.Tests/CountMinSketch/CmsTests.cs index 816b0385..5463725d 100644 --- a/tests/NRedisStack.Tests/CountMinSketch/CmsTests.cs +++ b/tests/NRedisStack.Tests/CountMinSketch/CmsTests.cs @@ -211,7 +211,7 @@ public async Task TestQueryAsync() Assert.Equal(new long[] { 10, 15 }, resp); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMerge() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -260,7 +260,7 @@ public void TestMerge() } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMergeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/Search/SearchTests.cs b/tests/NRedisStack.Tests/Search/SearchTests.cs index 8a465f57..4d11bae9 100644 --- a/tests/NRedisStack.Tests/Search/SearchTests.cs +++ b/tests/NRedisStack.Tests/Search/SearchTests.cs @@ -57,7 +57,7 @@ private void AddDocument(IDatabase db, string key, Dictionary<string, object> ob db.Execute("HSET", nameValue); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestAggregationRequestVerbatim() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -80,7 +80,7 @@ public void TestAggregationRequestVerbatim() Assert.Equal(0, res.TotalResults); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestAggregationRequestVerbatimAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -699,7 +699,7 @@ public async Task CreateWithFieldNamesAsync() Assert.Equal(1, nonAttribute.TotalResults); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void AlterAdd() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -763,7 +763,7 @@ public void AlterAdd() Assert.Equal(4, info.CursorStats.Count); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task AlterAddAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1039,7 +1039,7 @@ public async Task TestCursorAsync() catch (RedisException) { } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestAggregationGroupBy() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2622,7 +2622,7 @@ public async Task getSuggestionLengthAndDeleteSuggestionAsync() Assert.Equal(2L, await ft.SugLenAsync(key)); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestProfileSearch() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2646,7 +2646,7 @@ public void TestProfileSearch() Assert.Equal("1", iteratorsProfile["Size"].ToString()); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestProfileSearchAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2671,7 +2671,7 @@ public async Task TestProfileSearchAsync() } - [Fact] + [SkipIfRedis(Is.Enterprise)] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2701,7 +2701,7 @@ public void TestProfile() Assert.Equal(1, aggregateRes.TotalResults); } - [Fact] + [SkipIfRedis(Is.Enterprise)] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs b/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs index c7bb507c..9e748528 100644 --- a/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs +++ b/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs @@ -365,7 +365,7 @@ public async Task TestAddAsync() AssertMergedUnmergedNodes(tdigest, "tdadd", 0, 5); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMerge() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -388,7 +388,7 @@ public void TestMerge() } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestMergeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -411,7 +411,7 @@ public async Task TestMergeAsync() AssertMergedUnmergedNodes(tdigest, "td2", 3, 2); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void MergeMultiAndParams() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -432,7 +432,7 @@ public void MergeMultiAndParams() Assert.Equal(50, tdigest.Info("to").Compression); } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task MergeMultiAndParamsAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestQueryIndex.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestQueryIndex.cs index dd82f55e..cd49bad4 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestQueryIndex.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestQueryIndex.cs @@ -10,7 +10,7 @@ public class TestQueryIndex : AbstractNRedisStackTest, IDisposable public TestQueryIndex(RedisFixture redisFixture) : base(redisFixture) { } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestTSQueryIndex() { var db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestQueryIndexAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestQueryIndexAsync.cs index 0e1be023..92a084bd 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestQueryIndexAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestQueryIndexAsync.cs @@ -8,7 +8,7 @@ public class TestQueryIndexAsync : AbstractNRedisStackTest { public TestQueryIndexAsync(RedisFixture redisFixture) : base(redisFixture) { } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public async Task TestTSQueryIndex() { var keys = CreateKeyNames(2); From 9d1599c470ccebe95eebb49c102c6e4ce4d58fa4 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Thu, 28 Dec 2023 16:18:49 +0200 Subject: [PATCH 21/44] print the info --- tests/NRedisStack.Tests/Core Commands/CoreTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs index 9a3d763a..8eef8fe5 100644 --- a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs +++ b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs @@ -26,6 +26,8 @@ public void TestSimpleSetInfo() db.ClientSetInfo(SetInfoAttr.LibraryVersion, "1.2.3"); var info = db.Execute("CLIENT", "INFO").ToString(); + // Print the info: + Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"lib-name=TestLibraryName lib-ver=1.2.3\n", info); } @@ -40,6 +42,8 @@ public async Task TestSimpleSetInfoAsync() await db.ClientSetInfoAsync(SetInfoAttr.LibraryVersion, "1.2.3"); var info = db.Execute("CLIENT", "INFO").ToString(); + // Print the info: + Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"lib-name=TestLibraryName lib-ver=1.2.3\n", info); } @@ -54,6 +58,8 @@ public void TestSetInfoDefaultValue() db.Execute(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = db.Execute("CLIENT", "INFO").ToString(); + // Print the info: + Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"lib-name=NRedisStack(.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}\n", info); } @@ -68,6 +74,8 @@ public async Task TestSetInfoDefaultValueAsync() await db.ExecuteAsync(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = (await db.ExecuteAsync("CLIENT", "INFO")).ToString(); + // Print the info: + Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"lib-name=NRedisStack(.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}\n", info); } @@ -82,6 +90,8 @@ public void TestSetInfoWithValue() db.Execute(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = db.Execute("CLIENT", "INFO").ToString(); + // Print the info: + Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"NRedisStack(MyLibraryName;v1.0.0;.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}\n", info); } @@ -96,6 +106,8 @@ public async Task TestSetInfoWithValueAsync() await db.ExecuteAsync(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = (await db.ExecuteAsync("CLIENT", "INFO")).ToString(); + // Print the info: + Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"NRedisStack(MyLibraryName;v1.0.0;.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}\n", info); } From 3231fa0e28c4c4d940cf275d3b0619409e1bac32 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Thu, 28 Dec 2023 16:57:29 +0200 Subject: [PATCH 22/44] skip setinfo in enterprise --- .../Core Commands/CoreTests.cs | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs index 8eef8fe5..6a200bbb 100644 --- a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs +++ b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs @@ -14,8 +14,8 @@ public class CoreTests : AbstractNRedisStackTest, IDisposable { public CoreTests(RedisFixture redisFixture) : base(redisFixture) { } - - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + // TODO: understand why this test fails on enterprise + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public void TestSimpleSetInfo() { var redis = ConnectionMultiplexer.Connect("localhost"); @@ -26,12 +26,10 @@ public void TestSimpleSetInfo() db.ClientSetInfo(SetInfoAttr.LibraryVersion, "1.2.3"); var info = db.Execute("CLIENT", "INFO").ToString(); - // Print the info: - Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"lib-name=TestLibraryName lib-ver=1.2.3\n", info); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public async Task TestSimpleSetInfoAsync() { var redis = ConnectionMultiplexer.Connect("localhost"); @@ -42,12 +40,10 @@ public async Task TestSimpleSetInfoAsync() await db.ClientSetInfoAsync(SetInfoAttr.LibraryVersion, "1.2.3"); var info = db.Execute("CLIENT", "INFO").ToString(); - // Print the info: - Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"lib-name=TestLibraryName lib-ver=1.2.3\n", info); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public void TestSetInfoDefaultValue() { ResetInfoDefaults(); // demonstrate first connection @@ -58,12 +54,10 @@ public void TestSetInfoDefaultValue() db.Execute(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = db.Execute("CLIENT", "INFO").ToString(); - // Print the info: - Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"lib-name=NRedisStack(.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}\n", info); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public async Task TestSetInfoDefaultValueAsync() { ResetInfoDefaults(); // demonstrate first connection @@ -74,12 +68,10 @@ public async Task TestSetInfoDefaultValueAsync() await db.ExecuteAsync(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = (await db.ExecuteAsync("CLIENT", "INFO")).ToString(); - // Print the info: - Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"lib-name=NRedisStack(.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}\n", info); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public void TestSetInfoWithValue() { ResetInfoDefaults(); // demonstrate first connection @@ -90,12 +82,10 @@ public void TestSetInfoWithValue() db.Execute(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = db.Execute("CLIENT", "INFO").ToString(); - // Print the info: - Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"NRedisStack(MyLibraryName;v1.0.0;.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}\n", info); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public async Task TestSetInfoWithValueAsync() { ResetInfoDefaults(); // demonstrate first connection @@ -106,12 +96,10 @@ public async Task TestSetInfoWithValueAsync() await db.ExecuteAsync(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = (await db.ExecuteAsync("CLIENT", "INFO")).ToString(); - // Print the info: - Console.WriteLine($"\n#####\nThe info: {info}\n#####\n"); Assert.EndsWith($"NRedisStack(MyLibraryName;v1.0.0;.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}\n", info); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public void TestSetInfoNull() { ResetInfoDefaults(); // demonstrate first connection @@ -135,7 +123,7 @@ public void TestSetInfoNull() Assert.Equal(infoAfterLibNameToEnd, infoBeforeLibNameToEnd); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.1.242")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.1.242")] public async Task TestSetInfoNullAsync() { ResetInfoDefaults(); // demonstrate first connection From 8aba1641c8af469bb4b951d630fefda5b918d0e4 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Thu, 28 Dec 2023 17:32:37 +0200 Subject: [PATCH 23/44] change verbosity to detailed --- .github/workflows/integration.yml | 6 +++--- .github/workflows/reusable.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d29e352c..de45b973 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -65,7 +65,7 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test --environment="REDIS=127.0.0.1:6379" --no-build --verbosity normal + run: dotnet test --environment="REDIS=127.0.0.1:6379" --no-build --verbosity detailed NRedisStack-Enterprise-Test-OssCluster: name: NRedisStack Enterprise Test - OSS Cluster @@ -116,7 +116,7 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test --environment="REDIS_CLUSTER=127.0.0.1:6372" --environment="NUM_REDIS_CLUSTER_NODES=3" --no-build --verbosity normal + run: dotnet test --environment="REDIS_CLUSTER=127.0.0.1:6372" --environment="NUM_REDIS_CLUSTER_NODES=3" --no-build --verbosity detailed dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] @@ -226,4 +226,4 @@ jobs: shell: cmd run: | START wsl ./redis-stack-server-${{env.redis_stack_version}}/bin/redis-stack-server & - dotnet test -f net481 --no-build --verbosity normal + dotnet test -f net481 --no-build --verbosity detailed diff --git a/.github/workflows/reusable.yml b/.github/workflows/reusable.yml index 8d0b19cf..912566ac 100644 --- a/.github/workflows/reusable.yml +++ b/.github/workflows/reusable.yml @@ -63,7 +63,7 @@ jobs: echo "${{secrets.REDIS_USER_CRT}}" > tests/NRedisStack.Tests/bin/Debug/net6.0/redis_user.crt echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net6.0/redis_user_private.key ls -R - dotnet test -f ${{inputs.clr_version}} --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + dotnet test -f ${{inputs.clr_version}} --no-build --verbosity detailed /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Codecov uses: codecov/codecov-action@v3 with: From a1fa590e826ac0980e6d0975af703a4a710b0e07 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 10:25:12 +0200 Subject: [PATCH 24/44] dotnet format --- src/NRedisStack/TimeSeries/TimeSeriesAux.cs | 4 ++-- tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGet.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NRedisStack/TimeSeries/TimeSeriesAux.cs b/src/NRedisStack/TimeSeries/TimeSeriesAux.cs index 2cf7bb28..d884044e 100644 --- a/src/NRedisStack/TimeSeries/TimeSeriesAux.cs +++ b/src/NRedisStack/TimeSeries/TimeSeriesAux.cs @@ -81,7 +81,7 @@ public static void AddOnDuplicate(this IList<object> args, TsDuplicatePolicy? po public static void AddAlign(this IList<object> args, TimeStamp? alignMaybe) { - if (alignMaybe is {} align) + if (alignMaybe is { } align) { args.Add(TimeSeriesArgs.ALIGN); args.Add(align.Value); @@ -251,7 +251,7 @@ public static List<object> BuildTsIncrDecrByArgs(string key, double value, TimeS IReadOnlyCollection<TimeSeriesLabel>? labels, bool? uncompressed, long? chunkSizeBytes) { var args = new List<object> { key, value }; - if (timestampMaybe is {} timestamp) args.AddTimeStamp(timestamp); + if (timestampMaybe is { } timestamp) args.AddTimeStamp(timestamp); args.AddRetentionTime(retentionTime); args.AddChunkSize(chunkSizeBytes); if (labels != null) args.AddLabels(labels); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGet.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGet.cs index 132a1e6f..e2219c54 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGet.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMGet.cs @@ -12,7 +12,7 @@ public class TestMGet : AbstractNRedisStackTest, IDisposable public TestMGet(RedisFixture redisFixture) : base(redisFixture) { } - [SkipIfRedis(Is.OSSCluster,Is.Enterprise)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMGetQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); From dc82107eec3c7d10aaf7fe7937d030eb343282eb Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 12:09:19 +0200 Subject: [PATCH 25/44] use .env file --- .github/enterprise.env | 7 +++++++ .github/enterprise_cluster.env | 8 ++++++++ .github/workflows/integration.yml | 23 ++++++++++------------- 3 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 .github/enterprise.env create mode 100644 .github/enterprise_cluster.env diff --git a/.github/enterprise.env b/.github/enterprise.env new file mode 100644 index 00000000..287c9033 --- /dev/null +++ b/.github/enterprise.env @@ -0,0 +1,7 @@ +REDIS=127.0.0.1:6379 +IMAGE: redislabs/redis-internal:7.2.4-92 +RE_USERNAME: test@test.com +RE_PASS: 12345 +RE_CLUSTER_NAME: test +OSS_CLUSTER: false +DB_PORT: 6379 diff --git a/.github/enterprise_cluster.env b/.github/enterprise_cluster.env new file mode 100644 index 00000000..1a6c0801 --- /dev/null +++ b/.github/enterprise_cluster.env @@ -0,0 +1,8 @@ +REDIS_CLUSTER=127.0.0.1:6372 +NUM_REDIS_CLUSTER_NODES=3 +IMAGE: redislabs/redis-internal:7.2.4-92 +RE_USERNAME: test@test.com +RE_PASS: 12345 +RE_CLUSTER_NAME: test +OSS_CLUSTER: true +DB_PORT: 6378 \ No newline at end of file diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index de45b973..1d161a5a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -36,14 +36,13 @@ jobs: mkdir -p $DOCKER_CONFIG/cli-plugins curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + - name: set variables in dotenv + uses: c-py/action-dotenv-to-setenv@v2 + with: + env-file: .github/enterprise.env + - name: Build cluster env: - IMAGE: redislabs/redis-internal:7.2.4-92 - RE_USERNAME: test@test.com - RE_PASS: 12345 - RE_CLUSTER_NAME: test - OSS_CLUSTER: false - DB_PORT: 6379 DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} run: | @@ -87,14 +86,12 @@ jobs: mkdir -p $DOCKER_CONFIG/cli-plugins curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + - name: set variables in dotenv + uses: c-py/action-dotenv-to-setenv@v2 + with: + env-file: .github/enterprise_cluster.env - name: Build cluster env: - IMAGE: redislabs/redis-internal:7.2.4-92 - RE_USERNAME: test@test.com - RE_PASS: 12345 - RE_CLUSTER_NAME: test - OSS_CLUSTER: true - DB_PORT: 6378 DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} run: | @@ -226,4 +223,4 @@ jobs: shell: cmd run: | START wsl ./redis-stack-server-${{env.redis_stack_version}}/bin/redis-stack-server & - dotnet test -f net481 --no-build --verbosity detailed + dotnet test -f net481 --no-build --verbosity detailed \ No newline at end of file From 0fa434feaee124f78c1e5163c5da6c60ebacee14 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 12:28:42 +0200 Subject: [PATCH 26/44] checkout --- .github/workflows/integration.yml | 30 ++++++++++++++---------------- .github/workflows/reusable.yml | 1 - 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1d161a5a..bdefc4f0 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -30,12 +30,14 @@ jobs: run: | git clone https://github.com/RedisLabs/redis-ee-docker.git redis-ee - - name: Install Docker-compose - run: | - DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - mkdir -p $DOCKER_CONFIG/cli-plugins - curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + # - name: Install Docker-compose + # run: | + # DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + # mkdir -p $DOCKER_CONFIG/cli-plugins + # curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + - name: Checkout repository + uses: actions/checkout@v2 - name: set variables in dotenv uses: c-py/action-dotenv-to-setenv@v2 with: @@ -49,9 +51,6 @@ jobs: cd redis-ee/ ./build.sh - - name: Checkout repository - uses: actions/checkout@v2 - - name: .NET Core 7 uses: actions/setup-dotnet@v2 @@ -80,12 +79,14 @@ jobs: run: | git clone https://github.com/RedisLabs/redis-ee-docker.git redis-ee - - name: Install Docker-compose - run: | - DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - mkdir -p $DOCKER_CONFIG/cli-plugins - curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + # - name: Install Docker-compose + # run: | + # DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + # mkdir -p $DOCKER_CONFIG/cli-plugins + # curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + - name: Checkout repository + uses: actions/checkout@v2 - name: set variables in dotenv uses: c-py/action-dotenv-to-setenv@v2 with: @@ -98,9 +99,6 @@ jobs: cd redis-ee/ ./build.sh - - name: Checkout repository - uses: actions/checkout@v2 - - name: .NET Core 7 uses: actions/setup-dotnet@v2 diff --git a/.github/workflows/reusable.yml b/.github/workflows/reusable.yml index 912566ac..5c01668c 100644 --- a/.github/workflows/reusable.yml +++ b/.github/workflows/reusable.yml @@ -25,7 +25,6 @@ jobs: PASSWORD: ${{ secrets.PASSWORD }} ENDPOINT: ${{ secrets.ENDPOINT }} steps: - - uses: actions/checkout@v3 - name: .NET Core 6 From 90961ddd0fe71779b6643ba40fca3566f310bd50 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 12:31:48 +0200 Subject: [PATCH 27/44] chanfe : to = --- .github/enterprise.env | 12 ++++++------ .github/enterprise_cluster.env | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/enterprise.env b/.github/enterprise.env index 287c9033..8bda9f56 100644 --- a/.github/enterprise.env +++ b/.github/enterprise.env @@ -1,7 +1,7 @@ REDIS=127.0.0.1:6379 -IMAGE: redislabs/redis-internal:7.2.4-92 -RE_USERNAME: test@test.com -RE_PASS: 12345 -RE_CLUSTER_NAME: test -OSS_CLUSTER: false -DB_PORT: 6379 +IMAGE=redislabs/redis-internal:7.2.4-92 +RE_USERNAME=test@test.com +RE_PASS=12345 +RE_CLUSTER_NAME=test +OSS_CLUSTER=false +DB_PORT=6379 diff --git a/.github/enterprise_cluster.env b/.github/enterprise_cluster.env index 1a6c0801..d69ad9ee 100644 --- a/.github/enterprise_cluster.env +++ b/.github/enterprise_cluster.env @@ -1,8 +1,8 @@ REDIS_CLUSTER=127.0.0.1:6372 NUM_REDIS_CLUSTER_NODES=3 -IMAGE: redislabs/redis-internal:7.2.4-92 -RE_USERNAME: test@test.com -RE_PASS: 12345 -RE_CLUSTER_NAME: test -OSS_CLUSTER: true -DB_PORT: 6378 \ No newline at end of file +IMAGE=redislabs/redis-internal:7.2.4-92 +RE_USERNAME=test@test.com +RE_PASS=12345 +RE_CLUSTER_NAME=test +OSS_CLUSTER=true +DB_PORT=6378 \ No newline at end of file From a82a5a3d48540a076dbb2604c7c11a9d40162513 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 12:46:59 +0200 Subject: [PATCH 28/44] change to chayims method --- .github/{enterprise.env => .env.enterprise} | 0 ...se_cluster.env => .env.enterprise_cluster} | 0 .github/workflows/integration.yml | 42 +++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) rename .github/{enterprise.env => .env.enterprise} (100%) rename .github/{enterprise_cluster.env => .env.enterprise_cluster} (100%) diff --git a/.github/enterprise.env b/.github/.env.enterprise similarity index 100% rename from .github/enterprise.env rename to .github/.env.enterprise diff --git a/.github/enterprise_cluster.env b/.github/.env.enterprise_cluster similarity index 100% rename from .github/enterprise_cluster.env rename to .github/.env.enterprise_cluster diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index bdefc4f0..478c3474 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -16,40 +16,40 @@ concurrency: cancel-in-progress: true jobs: - NRedisStack-Enterprise-Test: - name: NRedisStack Enterprise Test - env: - IS_REDIS_ENTERPRISE: 'true' + enterprise-tests: + name: Redis Enterprise runs-on: ubuntu-latest strategy: fail-fast: false + matrix: + enterprise_version: ['7.2.4-92'] + oss_cluster: ['false'] steps: - - name: Clone Redis EE docker repository - run: | - git clone https://github.com/RedisLabs/redis-ee-docker.git redis-ee + - uses: actions/checkout@v4 - # - name: Install Docker-compose - # run: | - # DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - # mkdir -p $DOCKER_CONFIG/cli-plugins - # curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + - name: Load dotnenv for CI + uses: xom9ikk/dotenv@v2 + with: + path: .github + mode: enterprise - - name: Checkout repository - uses: actions/checkout@v2 - - name: set variables in dotenv - uses: c-py/action-dotenv-to-setenv@v2 + - name: clone ee docker code + uses: actions/checkout@v4 with: - env-file: .github/enterprise.env + repository: redislabs/redis-ee-docker + path: redis-ee-docker - - name: Build cluster + + - name: start docker + working-directory: redis-ee-docker env: + IMAGE: redislabs/redis-internal:${{ matrix.enterprise_version }} DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - run: | - cd redis-ee/ - ./build.sh + OSS_CLUSTER: ${{ matrix.oss_cluster }} + run: ./build.sh - name: .NET Core 7 uses: actions/setup-dotnet@v2 From be412232c840050af623d0e8a32c3842e45d307e Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 12:53:37 +0200 Subject: [PATCH 29/44] add IS_ENTERPRISE=true --- .github/.env.enterprise | 1 + .github/.env.enterprise_cluster | 1 + .github/workflows/integration.yml | 2 +- tests/NRedisStack.Tests/RedisFixture.cs | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/.env.enterprise b/.github/.env.enterprise index 8bda9f56..e169cf5f 100644 --- a/.github/.env.enterprise +++ b/.github/.env.enterprise @@ -1,4 +1,5 @@ REDIS=127.0.0.1:6379 +IS_ENTERPRISE=true IMAGE=redislabs/redis-internal:7.2.4-92 RE_USERNAME=test@test.com RE_PASS=12345 diff --git a/.github/.env.enterprise_cluster b/.github/.env.enterprise_cluster index d69ad9ee..5c1616bd 100644 --- a/.github/.env.enterprise_cluster +++ b/.github/.env.enterprise_cluster @@ -1,5 +1,6 @@ REDIS_CLUSTER=127.0.0.1:6372 NUM_REDIS_CLUSTER_NODES=3 +IS_ENTERPRISE=true IMAGE=redislabs/redis-internal:7.2.4-92 RE_USERNAME=test@test.com RE_PASS=12345 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 478c3474..c3556e9e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -68,7 +68,7 @@ jobs: NRedisStack-Enterprise-Test-OssCluster: name: NRedisStack Enterprise Test - OSS Cluster env: - IS_REDIS_ENTERPRISE: 'true' + IS_ENTERPRISE: 'true' runs-on: ubuntu-latest strategy: diff --git a/tests/NRedisStack.Tests/RedisFixture.cs b/tests/NRedisStack.Tests/RedisFixture.cs index f3b8fb79..4aab0f32 100644 --- a/tests/NRedisStack.Tests/RedisFixture.cs +++ b/tests/NRedisStack.Tests/RedisFixture.cs @@ -10,7 +10,7 @@ public class RedisFixture : IDisposable string redisStandalone = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; string? redisCluster = Environment.GetEnvironmentVariable("REDIS_CLUSTER"); string? numRedisClusterNodesEnv = Environment.GetEnvironmentVariable("NUM_REDIS_CLUSTER_NODES"); - public bool isEnterprise = Environment.GetEnvironmentVariable("IS_REDIS_ENTERPRISE") == "true"; + public bool isEnterprise = Environment.GetEnvironmentVariable("IS_ENTERPRISE") == "true"; public bool isOSSCluster = false; public RedisFixture() From 279a9fd7eec93f8120987296943ec0cdb20f4761 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 14:53:40 +0200 Subject: [PATCH 30/44] use matrix to run both tests --- ...se_cluster => .env.enterprise_oss_cluster} | 0 .github/workflows/integration.yml | 53 ++----------------- 2 files changed, 3 insertions(+), 50 deletions(-) rename .github/{.env.enterprise_cluster => .env.enterprise_oss_cluster} (100%) diff --git a/.github/.env.enterprise_cluster b/.github/.env.enterprise_oss_cluster similarity index 100% rename from .github/.env.enterprise_cluster rename to .github/.env.enterprise_oss_cluster diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index c3556e9e..c5bab633 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -25,6 +25,7 @@ jobs: matrix: enterprise_version: ['7.2.4-92'] oss_cluster: ['false'] + env_file_mode: ['enterprise', enterprise_oss_cluster] steps: - uses: actions/checkout@v4 @@ -33,7 +34,7 @@ jobs: uses: xom9ikk/dotenv@v2 with: path: .github - mode: enterprise + mode: ${{ matrix.env_file_mode }} - name: clone ee docker code uses: actions/checkout@v4 @@ -63,55 +64,7 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test --environment="REDIS=127.0.0.1:6379" --no-build --verbosity detailed - - NRedisStack-Enterprise-Test-OssCluster: - name: NRedisStack Enterprise Test - OSS Cluster - env: - IS_ENTERPRISE: 'true' - runs-on: ubuntu-latest - - strategy: - fail-fast: false - - steps: - - name: Clone Redis EE docker repository - run: | - git clone https://github.com/RedisLabs/redis-ee-docker.git redis-ee - - # - name: Install Docker-compose - # run: | - # DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - # mkdir -p $DOCKER_CONFIG/cli-plugins - # curl -SL https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose - - - name: Checkout repository - uses: actions/checkout@v2 - - name: set variables in dotenv - uses: c-py/action-dotenv-to-setenv@v2 - with: - env-file: .github/enterprise_cluster.env - - name: Build cluster - env: - DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - run: | - cd redis-ee/ - ./build.sh - - - name: .NET Core 7 - uses: actions/setup-dotnet@v2 - - with: - dotnet-version: '7.0.x' - - name: Restore dependencies - run: dotnet restore - - - name: Build - run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - - - name: Test - run: dotnet test --environment="REDIS_CLUSTER=127.0.0.1:6372" --environment="NUM_REDIS_CLUSTER_NODES=3" --no-build --verbosity detailed + run: dotnet test -f net7.0 --no-build --verbosity detailed dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] From 0843687d61e19fd74f0d6155cefb61cc2e93e425 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 14:54:29 +0200 Subject: [PATCH 31/44] add ' ' --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index c5bab633..81f2c7f4 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -25,7 +25,7 @@ jobs: matrix: enterprise_version: ['7.2.4-92'] oss_cluster: ['false'] - env_file_mode: ['enterprise', enterprise_oss_cluster] + env_file_mode: ['enterprise', 'enterprise_oss_cluster'] steps: - uses: actions/checkout@v4 From c3cec6ca010bb18abbcd9b0ba6ca4c7045616f3a Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 15:26:49 +0200 Subject: [PATCH 32/44] use xom9ikk/dotenv@v2 in reusable --- .github/workflows/integration.yml | 20 +++++++++---------- .github/{ => workflows/modes}/.env.enterprise | 1 - .../modes}/.env.enterprise_oss_cluster | 1 - .../modes/.env.oss_cluster} | 0 .../modes/.env.standalone} | 0 .github/workflows/reusable.yml | 9 +++++---- 6 files changed, 14 insertions(+), 17 deletions(-) rename .github/{ => workflows/modes}/.env.enterprise (89%) rename .github/{ => workflows/modes}/.env.enterprise_oss_cluster (91%) rename .github/{cluster.env => workflows/modes/.env.oss_cluster} (100%) rename .github/{standalone.env => workflows/modes/.env.standalone} (100%) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 81f2c7f4..43860d9a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -24,7 +24,6 @@ jobs: fail-fast: false matrix: enterprise_version: ['7.2.4-92'] - oss_cluster: ['false'] env_file_mode: ['enterprise', 'enterprise_oss_cluster'] steps: @@ -33,23 +32,22 @@ jobs: - name: Load dotnenv for CI uses: xom9ikk/dotenv@v2 with: - path: .github + path: .github/modes mode: ${{ matrix.env_file_mode }} - - name: clone ee docker code + - name: Clone ee docker code uses: actions/checkout@v4 with: repository: redislabs/redis-ee-docker path: redis-ee-docker - - name: start docker + - name: Start docker working-directory: redis-ee-docker env: IMAGE: redislabs/redis-internal:${{ matrix.enterprise_version }} DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - OSS_CLUSTER: ${{ matrix.oss_cluster }} run: ./build.sh - name: .NET Core 7 @@ -72,7 +70,7 @@ jobs: with: redis_stack_type: cluster clr_version: net6.0 - dotenv_file: .github/cluster.env + mode: oss_cluster secrets: inherit dotnet_6: @@ -86,7 +84,7 @@ jobs: with: redis_stack_type: ${{matrix.redis-stack-type}} clr_version: net6.0 - dotenv_file: .github/standalone.env + mode: standalone secrets: inherit dotnet_7_cluster: @@ -95,7 +93,7 @@ jobs: with: redis_stack_type: cluster clr_version: net7.0 - dotenv_file: .github/cluster.env + mode: oss_cluster secrets: inherit dotnet_7: @@ -109,7 +107,7 @@ jobs: with: redis_stack_type: ${{matrix.redis-stack-type}} clr_version: net7.0 - dotenv_file: .github/standalone.env + mode: standalone secrets: inherit dotnet_8_cluster: @@ -118,7 +116,7 @@ jobs: with: redis_stack_type: cluster clr_version: net8.0 - dotenv_file: .github/cluster.env + mode: oss_cluster secrets: inherit dotnet_8: @@ -132,7 +130,7 @@ jobs: with: redis_stack_type: ${{matrix.redis-stack-type}} clr_version: net8.0 - dotenv_file: .github/standalone.env + mode: standalone secrets: inherit build_and_test_windows: diff --git a/.github/.env.enterprise b/.github/workflows/modes/.env.enterprise similarity index 89% rename from .github/.env.enterprise rename to .github/workflows/modes/.env.enterprise index e169cf5f..37d6d3c9 100644 --- a/.github/.env.enterprise +++ b/.github/workflows/modes/.env.enterprise @@ -4,5 +4,4 @@ IMAGE=redislabs/redis-internal:7.2.4-92 RE_USERNAME=test@test.com RE_PASS=12345 RE_CLUSTER_NAME=test -OSS_CLUSTER=false DB_PORT=6379 diff --git a/.github/.env.enterprise_oss_cluster b/.github/workflows/modes/.env.enterprise_oss_cluster similarity index 91% rename from .github/.env.enterprise_oss_cluster rename to .github/workflows/modes/.env.enterprise_oss_cluster index 5c1616bd..f058c966 100644 --- a/.github/.env.enterprise_oss_cluster +++ b/.github/workflows/modes/.env.enterprise_oss_cluster @@ -5,5 +5,4 @@ IMAGE=redislabs/redis-internal:7.2.4-92 RE_USERNAME=test@test.com RE_PASS=12345 RE_CLUSTER_NAME=test -OSS_CLUSTER=true DB_PORT=6378 \ No newline at end of file diff --git a/.github/cluster.env b/.github/workflows/modes/.env.oss_cluster similarity index 100% rename from .github/cluster.env rename to .github/workflows/modes/.env.oss_cluster diff --git a/.github/standalone.env b/.github/workflows/modes/.env.standalone similarity index 100% rename from .github/standalone.env rename to .github/workflows/modes/.env.standalone diff --git a/.github/workflows/reusable.yml b/.github/workflows/reusable.yml index 5c01668c..c0af108a 100644 --- a/.github/workflows/reusable.yml +++ b/.github/workflows/reusable.yml @@ -11,7 +11,7 @@ on: required: true type: string - dotenv_file: + mode: required: true type: string jobs: @@ -47,10 +47,11 @@ jobs: working-directory: .github run: docker-compose up -d redis-stack-${{inputs.redis_stack_type}} - - name: set variables in dotenv - uses: c-py/action-dotenv-to-setenv@v2 + - name: Set .env variables + uses: xom9ikk/dotenv@v2 with: - env-file: ${{inputs.dotenv_file}} + path: .github/modes + mode: ${{ inputs.mode }} - name: Restore dependencies run: dotnet restore From ccf8f8bb2e9865a178e5f7efc24437c25491f7d6 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 15:42:08 +0200 Subject: [PATCH 33/44] fix path --- .github/workflows/integration.yml | 2 +- .github/workflows/reusable.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 43860d9a..3334a2eb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -32,7 +32,7 @@ jobs: - name: Load dotnenv for CI uses: xom9ikk/dotenv@v2 with: - path: .github/modes + path: .github/workflows/modes mode: ${{ matrix.env_file_mode }} - name: Clone ee docker code diff --git a/.github/workflows/reusable.yml b/.github/workflows/reusable.yml index c0af108a..96ff651f 100644 --- a/.github/workflows/reusable.yml +++ b/.github/workflows/reusable.yml @@ -50,7 +50,7 @@ jobs: - name: Set .env variables uses: xom9ikk/dotenv@v2 with: - path: .github/modes + path: .github/workflows/modes mode: ${{ inputs.mode }} - name: Restore dependencies From 83cd9399f820e6a486e6cb534d4dd7063801cc65 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 16:04:27 +0200 Subject: [PATCH 34/44] delete IMAGE from .env --- .github/workflows/modes/.env.enterprise | 1 - .github/workflows/modes/.env.enterprise_oss_cluster | 1 - .github/workflows/reusable.yml | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/modes/.env.enterprise b/.github/workflows/modes/.env.enterprise index 37d6d3c9..38e66c87 100644 --- a/.github/workflows/modes/.env.enterprise +++ b/.github/workflows/modes/.env.enterprise @@ -1,6 +1,5 @@ REDIS=127.0.0.1:6379 IS_ENTERPRISE=true -IMAGE=redislabs/redis-internal:7.2.4-92 RE_USERNAME=test@test.com RE_PASS=12345 RE_CLUSTER_NAME=test diff --git a/.github/workflows/modes/.env.enterprise_oss_cluster b/.github/workflows/modes/.env.enterprise_oss_cluster index f058c966..5a33d899 100644 --- a/.github/workflows/modes/.env.enterprise_oss_cluster +++ b/.github/workflows/modes/.env.enterprise_oss_cluster @@ -1,7 +1,6 @@ REDIS_CLUSTER=127.0.0.1:6372 NUM_REDIS_CLUSTER_NODES=3 IS_ENTERPRISE=true -IMAGE=redislabs/redis-internal:7.2.4-92 RE_USERNAME=test@test.com RE_PASS=12345 RE_CLUSTER_NAME=test diff --git a/.github/workflows/reusable.yml b/.github/workflows/reusable.yml index 96ff651f..a0db9c3e 100644 --- a/.github/workflows/reusable.yml +++ b/.github/workflows/reusable.yml @@ -43,7 +43,7 @@ jobs: dotnet-version: 8 dotnet-quality: 'preview' - - name: run redis-stack-server docker + - name: Run redis-stack-server docker working-directory: .github run: docker-compose up -d redis-stack-${{inputs.redis_stack_type}} From 40e8c8cf9daaefd37ced37cea07a4164e63ffd62 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 17:23:36 +0200 Subject: [PATCH 35/44] add OSS_CLUSTER to the .env's --- .github/workflows/modes/.env.enterprise | 1 + .github/workflows/modes/.env.enterprise_oss_cluster | 1 + tests/NRedisStack.Tests/SkipIfRedisAttribute.cs | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/modes/.env.enterprise b/.github/workflows/modes/.env.enterprise index 38e66c87..6238cf37 100644 --- a/.github/workflows/modes/.env.enterprise +++ b/.github/workflows/modes/.env.enterprise @@ -3,4 +3,5 @@ IS_ENTERPRISE=true RE_USERNAME=test@test.com RE_PASS=12345 RE_CLUSTER_NAME=test +OSS_CLUSTER=false DB_PORT=6379 diff --git a/.github/workflows/modes/.env.enterprise_oss_cluster b/.github/workflows/modes/.env.enterprise_oss_cluster index 5a33d899..738e034b 100644 --- a/.github/workflows/modes/.env.enterprise_oss_cluster +++ b/.github/workflows/modes/.env.enterprise_oss_cluster @@ -4,4 +4,5 @@ IS_ENTERPRISE=true RE_USERNAME=test@test.com RE_PASS=12345 RE_CLUSTER_NAME=test +OSS_CLUSTER=true DB_PORT=6378 \ No newline at end of file diff --git a/tests/NRedisStack.Tests/SkipIfRedisAttribute.cs b/tests/NRedisStack.Tests/SkipIfRedisAttribute.cs index ca9c6c22..b62dc17a 100644 --- a/tests/NRedisStack.Tests/SkipIfRedisAttribute.cs +++ b/tests/NRedisStack.Tests/SkipIfRedisAttribute.cs @@ -20,7 +20,6 @@ public class SkipIfRedisAttribute : FactAttribute private readonly string _targetVersion; private readonly Comparison _comparison; private readonly List<Is> _environments = new List<Is>(); - private readonly string DefaultRedisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; public SkipIfRedisAttribute( Is environment, From 1badfedf7708bf91ed98907e1c2e3e8197f2bb68 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 17:55:57 +0200 Subject: [PATCH 36/44] skip if oss cluster --- tests/NRedisStack.Tests/Search/SearchTests.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/NRedisStack.Tests/Search/SearchTests.cs b/tests/NRedisStack.Tests/Search/SearchTests.cs index 4d11bae9..12660136 100644 --- a/tests/NRedisStack.Tests/Search/SearchTests.cs +++ b/tests/NRedisStack.Tests/Search/SearchTests.cs @@ -284,7 +284,7 @@ public async Task TestAggregationsLoadAsync() - [Fact] + [SkipIfRedis(Is.OSSCluster)] public void TestAggregationRequestParamsDialect() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -315,7 +315,7 @@ public void TestAggregationRequestParamsDialect() Assert.Equal(10, r1.GetLong("sum")); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public async Task TestAggregationRequestParamsDialectAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -350,7 +350,7 @@ public async Task TestAggregationRequestParamsDialectAsync() Assert.Equal(10, r1.GetLong("sum")); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public void TestAggregationRequestParamsWithDefaultDialect() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -381,7 +381,7 @@ public void TestAggregationRequestParamsWithDefaultDialect() Assert.Equal(10, r1.GetLong("sum")); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public async Task TestAggregationRequestParamsWithDefaultDialectAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1304,7 +1304,7 @@ public async Task TestDictionaryAsync() } string explainQuery = "@f3:f3_val @f2:f2_val @f1:f1_val"; - [Fact] + [SkipIfRedis(Is.OSSCluster)] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1328,7 +1328,7 @@ public void TestExplain() } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1431,7 +1431,7 @@ public async Task TestExplainWithDefaultDialectAsync() Assert.False(res.Length == 0); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public void TestSynonym() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1457,7 +1457,7 @@ public void TestSynonym() Assert.Equal(expected, dump); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public async Task TestSynonymAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1780,7 +1780,7 @@ public async Task TestFiltersAsync() Assert.Equal("doc1", res1.Documents[0].Id); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public void TestQueryCommandBuilder() { var testQuery = new Query("foo").HighlightFields(new Query.HighlightTags("<b>", "</b>"), "txt") @@ -1878,7 +1878,7 @@ public void TestQueryCommandBuilder() Assert.Empty(res.Documents); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public void TestQueryCommandBuilderReturnField() { var testQuery = new Query("foo").HighlightFields("txt") @@ -2238,7 +2238,7 @@ public void TestQueryParamsWithParams_DefaultDialect() Assert.Equal(2, res.TotalResults); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public void TestBasicSpellCheck() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2258,7 +2258,7 @@ public void TestBasicSpellCheck() Assert.Equal(2, reply["name"]["name2"]); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public async Task TestBasicSpellCheckAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); From 76f2558bc6f5d5ac2066824203e7de73f1d05ba0 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 31 Dec 2023 18:02:25 +0200 Subject: [PATCH 37/44] skip oss cluster --- tests/NRedisStack.Tests/Search/SearchTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/NRedisStack.Tests/Search/SearchTests.cs b/tests/NRedisStack.Tests/Search/SearchTests.cs index 12660136..7bb350ef 100644 --- a/tests/NRedisStack.Tests/Search/SearchTests.cs +++ b/tests/NRedisStack.Tests/Search/SearchTests.cs @@ -103,7 +103,7 @@ public async Task TestAggregationRequestVerbatimAsync() Assert.Equal(0, res.TotalResults); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public void TestAggregationRequestTimeout() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -125,7 +125,7 @@ public void TestAggregationRequestTimeout() Assert.Equal(2, res.TotalResults); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public async Task TestAggregationRequestTimeoutAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1397,7 +1397,7 @@ public async Task TestExplainCliAsync() Assert.False(res.Length == 0); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public void TestExplainWithDefaultDialect() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1414,7 +1414,7 @@ public void TestExplainWithDefaultDialect() Assert.False(res.Length == 0); } - [Fact] + [SkipIfRedis(Is.OSSCluster)] public async Task TestExplainWithDefaultDialectAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); From f352c801fa0f898caae7c7fa3e0700baa5dc2de4 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Tue, 2 Jan 2024 15:17:55 +0200 Subject: [PATCH 38/44] update var names --- .github/workflows/modes/.env.enterprise | 4 ++-- .github/workflows/modes/.env.enterprise_oss_cluster | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/modes/.env.enterprise b/.github/workflows/modes/.env.enterprise index 6238cf37..9a57f7f5 100644 --- a/.github/workflows/modes/.env.enterprise +++ b/.github/workflows/modes/.env.enterprise @@ -3,5 +3,5 @@ IS_ENTERPRISE=true RE_USERNAME=test@test.com RE_PASS=12345 RE_CLUSTER_NAME=test -OSS_CLUSTER=false -DB_PORT=6379 +RE_USE_OSS_CLUSTER=false +RE_DB_PORT=6379 diff --git a/.github/workflows/modes/.env.enterprise_oss_cluster b/.github/workflows/modes/.env.enterprise_oss_cluster index 738e034b..1b81f571 100644 --- a/.github/workflows/modes/.env.enterprise_oss_cluster +++ b/.github/workflows/modes/.env.enterprise_oss_cluster @@ -4,5 +4,5 @@ IS_ENTERPRISE=true RE_USERNAME=test@test.com RE_PASS=12345 RE_CLUSTER_NAME=test -OSS_CLUSTER=true -DB_PORT=6378 \ No newline at end of file +RE_USE_OSS_CLUSTER=true +RE_DB_PORT=6378 \ No newline at end of file From 0117091da9b0c8c83b5a860a61be581ca48c4400 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Thu, 22 Feb 2024 17:59:01 +0200 Subject: [PATCH 39/44] fix integrations --- .github/workflows/integration.yml | 12 ++++++------ .github/workflows/reusable.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 396ccb04..23c841bd 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -70,8 +70,8 @@ jobs: with: redis_stack_type: cluster clr_version: net6.0 + mode: oss_cluster dotnet_sdk_version: 6.0.0 - dotenv_file: .github/cluster.env secrets: inherit dotnet_6: @@ -85,8 +85,8 @@ jobs: with: redis_stack_type: ${{matrix.redis-stack-type}} clr_version: net6.0 + mode: standalone dotnet_sdk_version: 6.0.0 - dotenv_file: .github/standalone.env secrets: inherit dotnet_7_cluster: @@ -95,8 +95,8 @@ jobs: with: redis_stack_type: cluster clr_version: net7.0 + mode: oss_cluster dotnet_sdk_version: 7.0.0 - dotenv_file: .github/cluster.env secrets: inherit dotnet_7: @@ -110,8 +110,8 @@ jobs: with: redis_stack_type: ${{matrix.redis-stack-type}} clr_version: net7.0 + mode: standalone dotnet_sdk_version: 7.0.0 - dotenv_file: .github/standalone.env secrets: inherit dotnet_8_cluster: @@ -120,8 +120,8 @@ jobs: with: redis_stack_type: cluster clr_version: net8.0 + mode: oss_cluster dotnet_sdk_version: 8.0.0 - dotenv_file: .github/cluster.env secrets: inherit dotnet_8: @@ -135,8 +135,8 @@ jobs: with: redis_stack_type: ${{matrix.redis-stack-type}} clr_version: net8.0 + mode: standalone dotnet_sdk_version: 8.0.0 - dotenv_file: .github/standalone.env secrets: inherit build_and_test_windows: diff --git a/.github/workflows/reusable.yml b/.github/workflows/reusable.yml index 711a9f54..9eb29af8 100644 --- a/.github/workflows/reusable.yml +++ b/.github/workflows/reusable.yml @@ -19,7 +19,7 @@ on: required: true type: string - dotenv_file: + mode: required: true type: string jobs: From 713ffa31b56a71f2d6b0cee12a1909b7ce2d6f4f Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 25 Feb 2024 12:44:23 +0200 Subject: [PATCH 40/44] change to .net 8 --- .github/workflows/integration.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 23c841bd..3c5afebf 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -50,11 +50,11 @@ jobs: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} run: ./build.sh - - name: .NET Core 7 + - name: .NET Core 8 uses: actions/setup-dotnet@v2 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: Restore dependencies run: dotnet restore @@ -62,7 +62,7 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test -f net7.0 --no-build --verbosity detailed + run: dotnet test -f net8.0 --no-build --verbosity detailed dotnet_6_cluster: name: .NET 6 on [redis-stack cluster] From 8d2ddbfc3b3e95dcfea2c66704b8f483b8f13569 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 25 Feb 2024 12:44:47 +0200 Subject: [PATCH 41/44] add lcov to gitignor --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fd1be9e5..b67a9384 100644 --- a/.gitignore +++ b/.gitignore @@ -408,3 +408,4 @@ tests/NRedisStack.Tests/redis_credentials/redis_user.crt # global.json global.json +tests/NRedisStack.Tests/lcov.net8.0.info From 7f3b13dfd68155e317c786abd9f75999cfc9d0cf Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 25 Feb 2024 13:08:12 +0200 Subject: [PATCH 42/44] Skip tests if enterprise --- tests/NRedisStack.Tests/Core Commands/CoreTests.cs | 14 +++++++------- .../TimeSeries/TestAPI/TestMRange.cs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs index c5b74df0..aa40c58a 100644 --- a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs +++ b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs @@ -196,7 +196,7 @@ public void TestBZMPopMultiplexerTimeout() Assert.Throws<RedisTimeoutException>(() => db.BZMPop(0, "my-set", MinMaxModifier.Min)); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBZMPopMultipleSets() { var db = redisFixture.Redis.GetDatabase(null); @@ -307,7 +307,7 @@ public void TestBZPopMinNull() Assert.Null(result); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "5.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "5.0.0")] public void TestBZPopMinMultipleSets() { var db = redisFixture.Redis.GetDatabase(null); @@ -426,7 +426,7 @@ public void TestBLMPopNull() Assert.Null(result); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBLMPopMultipleLists() { var db = redisFixture.Redis.GetDatabase(null); @@ -505,7 +505,7 @@ public void TestBLPopNull() Assert.Null(result); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "2.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "2.0.0")] public void TestBLPopMultipleLists() { var db = redisFixture.Redis.GetDatabase(null); @@ -556,7 +556,7 @@ public void TestBRPopNull() Assert.Null(result); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "2.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "2.0.0")] public void TestBRPopMultipleLists() { var db = redisFixture.Redis.GetDatabase(null); @@ -579,7 +579,7 @@ public void TestBRPopMultipleLists() Assert.Equal("b", result.Item2.ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "6.2.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "6.2.0")] public void TestBLMove() { var db = redisFixture.Redis.GetDatabase(null); @@ -636,7 +636,7 @@ public void TestBLMove() Assert.Equal("c", db.ListGetByIndex("list-two", 1)); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "2.2.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "2.2.0")] public void TestBRPopLPush() { var db = redisFixture.Redis.GetDatabase(null); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRange.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRange.cs index 5a1e61d0..1c12a4be 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRange.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMRange.cs @@ -308,7 +308,7 @@ public void TestMRangeFilterBy() } } - [SkipIfRedis(Is.OSSCluster)] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise)] public void TestMRangeLatest() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -319,7 +319,7 @@ public void TestMRangeLatest() string primaryTsKey = _keys[0], compactedTsKey = _keys[1]; var compactionRule = new TimeSeriesRule( compactedTsKey, - (long)TimeSpan.FromHours(1).TotalMilliseconds, // 1h used to force partial bucket + (long)TimeSpan.FromHours(1).TotalMilliseconds, // 1h used to force partial bucket TsAggregation.Sum); ts.Create(primaryTsKey, labels: new[] { label }); From 1ded97bb8582df65a338655b830dbee2eece0741 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 25 Feb 2024 13:26:23 +0200 Subject: [PATCH 43/44] skip TestBLMPop if enterprise --- tests/NRedisStack.Tests/Core Commands/CoreTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs index aa40c58a..482de6a0 100644 --- a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs +++ b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs @@ -384,7 +384,7 @@ public void TestBZPopMaxMultipleSets() Assert.Equal("b", result.Item2.Value.ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBLMPop() { var db = redisFixture.Redis.GetDatabase(null); From 4f5da2a78ed78c2b1ba7960a63651406aa86cd32 Mon Sep 17 00:00:00 2001 From: shacharPash <shachar.pashchur@redis.com> Date: Sun, 25 Feb 2024 13:37:54 +0200 Subject: [PATCH 44/44] skip all blocking commands if enterprise --- .../Core Commands/CoreTests.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs index 482de6a0..dfad0471 100644 --- a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs +++ b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs @@ -137,7 +137,7 @@ public async Task TestSetInfoNullAsync() Assert.Equal(infoAfterLibNameToEnd, infoBeforeLibNameToEnd); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBZMPop() { var db = redisFixture.Redis.GetDatabase(null); @@ -169,7 +169,7 @@ public void TestBZMPop() Assert.Equal("d", resultWithDescendingOrder.Item2[0].Value.ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBZMPopNull() { var db = redisFixture.Redis.GetDatabase(null); @@ -181,7 +181,7 @@ public void TestBZMPopNull() Assert.Null(result); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBZMPopMultiplexerTimeout() { var configurationOptions = new ConfigurationOptions(); @@ -238,7 +238,7 @@ public void TestBZMPopMultipleSets() Assert.Equal("c", result.Item2[1].Value.ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBZMPopNoKeysProvided() { var db = redisFixture.Redis.GetDatabase(null); @@ -247,7 +247,7 @@ public void TestBZMPopNoKeysProvided() Assert.Throws<ArgumentException>(() => db.BZMPop(0, Array.Empty<RedisKey>(), MinMaxModifier.Min)); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBZMPopWithOrderEnum() { var db = redisFixture.Redis.GetDatabase(null); @@ -276,7 +276,7 @@ public void TestBZMPopWithOrderEnum() Assert.Equal("b", resultWithDescendingOrder.Item2[0].Value.ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "5.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "5.0.0")] public void TestBZPopMin() { var db = redisFixture.Redis.GetDatabase(null); @@ -295,7 +295,7 @@ public void TestBZPopMin() Assert.Equal(1.5, result.Item2.Score); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "5.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "5.0.0")] public void TestBZPopMinNull() { var db = redisFixture.Redis.GetDatabase(null); @@ -330,7 +330,7 @@ public void TestBZPopMinMultipleSets() Assert.Equal("a", result.Item2.Value.ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "5.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "5.0.0")] public void TestBZPopMax() { var db = redisFixture.Redis.GetDatabase(null); @@ -349,7 +349,7 @@ public void TestBZPopMax() Assert.Equal(5.1, result.Item2.Score); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "5.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "5.0.0")] public void TestBZPopMaxNull() { var db = redisFixture.Redis.GetDatabase(null); @@ -361,7 +361,7 @@ public void TestBZPopMaxNull() Assert.Null(result); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "5.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "5.0.0")] public void TestBZPopMaxMultipleSets() { var db = redisFixture.Redis.GetDatabase(null); @@ -414,7 +414,7 @@ public void TestBLMPop() Assert.Equal("e", resultWithDescendingOrder.Item2[0].ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBLMPopNull() { var db = redisFixture.Redis.GetDatabase(null); @@ -468,7 +468,7 @@ public void TestBLMPopMultipleLists() Assert.Equal("b", result.Item2[1].ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "7.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "7.0.0")] public void TestBLMPopNoKeysProvided() { var db = redisFixture.Redis.GetDatabase(null); @@ -477,7 +477,7 @@ public void TestBLMPopNoKeysProvided() Assert.Throws<ArgumentException>(() => db.BLMPop(0, Array.Empty<RedisKey>(), ListSide.Left)); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "2.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "2.0.0")] public void TestBLPop() { var db = redisFixture.Redis.GetDatabase(null); @@ -493,7 +493,7 @@ public void TestBLPop() Assert.Equal("a", result.Item2.ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "2.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "2.0.0")] public void TestBLPopNull() { var db = redisFixture.Redis.GetDatabase(null); @@ -528,7 +528,7 @@ public void TestBLPopMultipleLists() Assert.Equal("a", result.Item2.ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "2.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "2.0.0")] public void TestBRPop() { var db = redisFixture.Redis.GetDatabase(null); @@ -544,7 +544,7 @@ public void TestBRPop() Assert.Equal("b", result.Item2.ToString()); } - [SkipIfRedis(Is.OSSCluster, Comparison.LessThan, "2.0.0")] + [SkipIfRedis(Is.OSSCluster, Is.Enterprise, Comparison.LessThan, "2.0.0")] public void TestBRPopNull() { var db = redisFixture.Redis.GetDatabase(null);