From a765325315f9457260482c36bfa7445f374fd996 Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Mon, 31 Jul 2023 10:22:21 +0300 Subject: [PATCH 01/22] Redis version bump for testing --- .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 7a666e50..ba4f7c46 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - redis-stack-version: ["6.2.6-v7", "7.0.6-RC8", "edge"] + redis-stack-version: ["6.2.6-v9", "7.2.0-rc3", "edge"] env: USER_NAME: ${{ secrets.USER_NAME }} PASSWORD: ${{ secrets.PASSWORD }} From bf875f4cb89742b9a3effd12d40e7793a7150045 Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 1 Aug 2023 11:41:57 +0300 Subject: [PATCH 02/22] change RC to Uppercase --- .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 ba4f7c46..299fe5ef 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - redis-stack-version: ["6.2.6-v9", "7.2.0-rc3", "edge"] + redis-stack-version: ["6.2.6-v9", "7.2.0-RC3", "edge"] env: USER_NAME: ${{ secrets.USER_NAME }} PASSWORD: ${{ secrets.PASSWORD }} From 80be48ba4c14fd272371ba745416ed9c70e4b86f Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 6 Aug 2023 17:21:52 +0300 Subject: [PATCH 03/22] skip graph tests if version is 7.2.0-RC3 --- .github/workflows/integration.yml | 2 + tests/NRedisStack.Tests/Graph/GraphTests.cs | 64 +++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 299fe5ef..12a4435e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,6 +48,8 @@ jobs: ls -R if [ "$REDIS_VERSION" != "edge" ]; then dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge + else if [ "$REDIS_VERSION" != "7.2.0-RC3" ]; then + dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=7.2.0-RC3 else dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover fi diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index d539de78..5e22f118 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -21,6 +21,7 @@ public void Dispose() #region SyncTests [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -29,6 +30,7 @@ public void TestReserveBasic() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -52,6 +54,7 @@ public void TestCreateNode() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -73,6 +76,7 @@ public void TestCreateLabeledNode() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -100,6 +104,7 @@ public void TestConnectNodes() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -147,6 +152,7 @@ public void TestDeleteNodes() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -177,6 +183,7 @@ public void TestDeleteRelationship() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -204,6 +211,7 @@ public void TestIndex() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -235,6 +243,7 @@ public void TestHeader() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -360,6 +369,7 @@ public void TestRecord() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -440,6 +450,7 @@ record = iterator.Current; } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -459,6 +470,7 @@ public void TestEscapedQuery() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -559,6 +571,7 @@ record = iterator.Current; } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -611,6 +624,7 @@ public void TestPath() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -665,6 +679,7 @@ record = resultSet.Skip(1).First(); } [Fact] + [Trait("Category", "7.2.0-RC3")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -683,6 +698,7 @@ public void Test64BitNumber() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -714,6 +730,7 @@ public void TestCachedExecution() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -744,6 +761,7 @@ public void TestMapDataType() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -758,6 +776,7 @@ public void TestGeoPointLatLon() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -787,6 +806,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -799,6 +819,7 @@ public void TestPoint() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -813,6 +834,7 @@ public void timeoutArgument() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -846,6 +868,7 @@ public void TestCachedExecutionReadOnly() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -861,6 +884,7 @@ public void TestSimpleReadOnly() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -879,6 +903,7 @@ public void TestProfile() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -897,6 +922,7 @@ public void TestExplain() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -912,6 +938,7 @@ public void TestSlowlog() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -925,6 +952,7 @@ public void TestList() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -945,6 +973,7 @@ public void TestConfig() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -957,6 +986,7 @@ public void TestModulePrefixs() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -978,6 +1008,7 @@ public void TestCallProcedureDbLabels() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1004,6 +1035,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1012,6 +1044,7 @@ public async Task TestReserveBasicAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1035,6 +1068,7 @@ public async Task TestCreateNodeAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1056,6 +1090,7 @@ public async Task TestCreateLabeledNodeAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1084,6 +1119,7 @@ public async Task TestConnectNodesAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1131,6 +1167,7 @@ public async Task TestDeleteNodesAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1161,6 +1198,7 @@ public async Task TestDeleteRelationshipAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1188,6 +1226,7 @@ public async Task TestIndexAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1219,6 +1258,7 @@ public async Task TestHeaderAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1346,6 +1386,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1426,6 +1467,7 @@ record = iterator.Current; } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1445,6 +1487,7 @@ public async Task TestEscapedQueryAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1545,6 +1588,7 @@ record = iterator.Current; } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1597,6 +1641,7 @@ public async Task TestPathAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1651,6 +1696,7 @@ record = resultSet.Skip(1).First(); } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1669,6 +1715,7 @@ public async Task Test64bitnumberAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1700,6 +1747,7 @@ public async Task TestCachedExecutionAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1730,6 +1778,7 @@ public async Task TestMapDataTypeAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1744,6 +1793,7 @@ public async Task TestGeoPointLatLonAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1772,6 +1822,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1786,6 +1837,7 @@ public async Task timeoutArgumentAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1819,6 +1871,7 @@ public async Task TestCachedExecutionReadOnlyAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1834,6 +1887,7 @@ public async Task TestSimpleReadOnlyAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1852,6 +1906,7 @@ public async Task TestProfileAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1870,6 +1925,7 @@ public async Task TestExplainAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1885,6 +1941,7 @@ public async Task TestSlowlogAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1898,6 +1955,7 @@ public async Task TestListAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1918,6 +1976,7 @@ public async Task TestConfigAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1930,6 +1989,7 @@ public async Task TestModulePrefixsAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1951,6 +2011,7 @@ public async Task TestCallProcedureDbLabelsAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1973,6 +2034,7 @@ public async Task TestCallProcedureReadOnlyAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1987,6 +2049,7 @@ public void TestParseInfinity() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2064,6 +2127,7 @@ public void TestEqualsAndToString() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; From 5eaf4256b3cf23bf0a8f337b46e51fe67e8cd7e5 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 6 Aug 2023 17:55:12 +0300 Subject: [PATCH 04/22] delete new traits --- tests/NRedisStack.Tests/Graph/GraphTests.cs | 98 ++++----------------- 1 file changed, 17 insertions(+), 81 deletions(-) diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index 5e22f118..e2129aa9 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -21,7 +21,6 @@ public void Dispose() #region SyncTests [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -30,7 +29,6 @@ public void TestReserveBasic() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -54,7 +52,6 @@ public void TestCreateNode() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -76,7 +73,6 @@ public void TestCreateLabeledNode() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -104,7 +100,6 @@ public void TestConnectNodes() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -152,7 +147,6 @@ public void TestDeleteNodes() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -183,7 +177,6 @@ public void TestDeleteRelationship() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -211,7 +204,6 @@ public void TestIndex() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -243,7 +235,6 @@ public void TestHeader() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -369,7 +360,6 @@ public void TestRecord() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -450,7 +440,6 @@ record = iterator.Current; } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -470,7 +459,6 @@ public void TestEscapedQuery() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -571,7 +559,6 @@ record = iterator.Current; } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -624,7 +611,6 @@ public void TestPath() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -679,7 +665,6 @@ record = resultSet.Skip(1).First(); } [Fact] - [Trait("Category", "7.2.0-RC3")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -698,7 +683,6 @@ public void Test64BitNumber() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -730,7 +714,6 @@ public void TestCachedExecution() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -761,7 +744,6 @@ public void TestMapDataType() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -776,7 +758,6 @@ public void TestGeoPointLatLon() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -806,7 +787,6 @@ private void AssertTestGeoPoint(IGraphCommands graph) } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -819,7 +799,6 @@ public void TestPoint() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -834,7 +813,6 @@ public void timeoutArgument() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -868,7 +846,6 @@ public void TestCachedExecutionReadOnly() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -884,7 +861,6 @@ public void TestSimpleReadOnly() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -903,7 +879,6 @@ public void TestProfile() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -922,7 +897,6 @@ public void TestExplain() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -938,7 +912,6 @@ public void TestSlowlog() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -952,7 +925,6 @@ public void TestList() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -973,7 +945,6 @@ public void TestConfig() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -986,7 +957,6 @@ public void TestModulePrefixs() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -1008,7 +978,6 @@ public void TestCallProcedureDbLabels() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1035,7 +1004,6 @@ public void TestCallProcedureReadOnly() #region AsyncTests [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1044,7 +1012,6 @@ public async Task TestReserveBasicAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1068,7 +1035,6 @@ public async Task TestCreateNodeAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1090,7 +1056,6 @@ public async Task TestCreateLabeledNodeAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1119,7 +1084,6 @@ public async Task TestConnectNodesAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1167,7 +1131,6 @@ public async Task TestDeleteNodesAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1198,7 +1161,6 @@ public async Task TestDeleteRelationshipAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1226,7 +1188,6 @@ public async Task TestIndexAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1258,7 +1219,6 @@ public async Task TestHeaderAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1386,7 +1346,6 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1467,7 +1426,6 @@ record = iterator.Current; } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1487,7 +1445,6 @@ public async Task TestEscapedQueryAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1588,7 +1545,6 @@ record = iterator.Current; } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1641,7 +1597,6 @@ public async Task TestPathAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1696,7 +1651,6 @@ record = resultSet.Skip(1).First(); } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1715,7 +1669,6 @@ public async Task Test64bitnumberAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1747,7 +1700,6 @@ public async Task TestCachedExecutionAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1778,7 +1730,6 @@ public async Task TestMapDataTypeAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1793,7 +1744,6 @@ public async Task TestGeoPointLatLonAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1822,7 +1772,6 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1837,7 +1786,6 @@ public async Task timeoutArgumentAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1871,7 +1819,6 @@ public async Task TestCachedExecutionReadOnlyAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1887,7 +1834,6 @@ public async Task TestSimpleReadOnlyAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1906,7 +1852,6 @@ public async Task TestProfileAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1925,7 +1870,6 @@ public async Task TestExplainAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1941,7 +1885,6 @@ public async Task TestSlowlogAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1955,7 +1898,6 @@ public async Task TestListAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1976,7 +1918,6 @@ public async Task TestConfigAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1989,7 +1930,6 @@ public async Task TestModulePrefixsAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -2011,7 +1951,6 @@ public async Task TestCallProcedureDbLabelsAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -2034,7 +1973,6 @@ public async Task TestCallProcedureReadOnlyAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2049,7 +1987,6 @@ public void TestParseInfinity() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2127,7 +2064,6 @@ public void TestEqualsAndToString() } [Fact] - [Trait("Category", "7.2.0-RC3")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; @@ -2136,7 +2072,7 @@ public void TestPrepareQuery() var graph = redisFixture.Redis.GetDatabase().GRAPH(); // handle chars - var buildCommand = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", (char)'c' }} ); + var buildCommand = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", (char)'c' } }); var expectedPreparedQuery1 = $"CYPHER a=\"c\" {return1Query}"; Assert.Equal(expectedPreparedQuery1, buildCommand.Args[1].ToString()!); var res1 = graph.Query("graph", buildCommand.Args[1].ToString()!); @@ -2146,64 +2082,64 @@ public void TestPrepareQuery() // handle null var buildCommand2 = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", null } }); var expectedPreparedQuery2 = $"CYPHER a=null {return1Query}"; - Assert.Equal(expectedPreparedQuery2,buildCommand2.Args[1].ToString()!); - var res2 = graph.Query("graph",buildCommand2.Args[1].ToString()!); + Assert.Equal(expectedPreparedQuery2, buildCommand2.Args[1].ToString()!); + var res2 = graph.Query("graph", buildCommand2.Args[1].ToString()!); Assert.Single(res2); Assert.Equal(return1QueryRecordString, res2.Single().ToString()); // handle arrays var buildCommand3 = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", new string[] { "foo", "bar" } } }); var expectedPreparedQuery3 = $"CYPHER a=[\"foo\", \"bar\"] {return1Query}"; - Assert.Equal(expectedPreparedQuery3,buildCommand3.Args[1].ToString()!); - var res3 = graph.Query("graph",buildCommand3.Args[1].ToString()!); + Assert.Equal(expectedPreparedQuery3, buildCommand3.Args[1].ToString()!); + var res3 = graph.Query("graph", buildCommand3.Args[1].ToString()!); Assert.Single(res3); Assert.Equal(return1QueryRecordString, res3.Single().ToString()); // handle lists var buildCommand4 = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", new List { "foo2", "bar2" } } }); var expectedPreparedQuery4 = $"CYPHER a=[\"foo2\", \"bar2\"] {return1Query}"; - Assert.Equal(expectedPreparedQuery4,buildCommand4.Args[1].ToString()!); - var res4 = graph.Query("graph",buildCommand4.Args[1].ToString()!); + Assert.Equal(expectedPreparedQuery4, buildCommand4.Args[1].ToString()!); + var res4 = graph.Query("graph", buildCommand4.Args[1].ToString()!); Assert.Single(res4); Assert.Equal(return1QueryRecordString, res4.Single().ToString()); // handle bools var buildCommand5 = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", true }, { "b", false } }); var expectedPreparedQuery5 = $"CYPHER a=true b=false {return1Query}"; - Assert.Equal(expectedPreparedQuery5,buildCommand5.Args[1].ToString()!); - var res5 = graph.Query("graph",buildCommand5.Args[1].ToString()!); + Assert.Equal(expectedPreparedQuery5, buildCommand5.Args[1].ToString()!); + var res5 = graph.Query("graph", buildCommand5.Args[1].ToString()!); Assert.Single(res5); Assert.Equal(return1QueryRecordString, res4.Single().ToString()); // handle floats var buildCommand6 = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", 1.4d } }); var expectedPreparedQuery6 = $"CYPHER a=1.4 {return1Query}"; - Assert.Equal(expectedPreparedQuery6,buildCommand6.Args[1].ToString()!); - var res6 = graph.Query("graph",buildCommand6.Args[1].ToString()!); + Assert.Equal(expectedPreparedQuery6, buildCommand6.Args[1].ToString()!); + var res6 = graph.Query("graph", buildCommand6.Args[1].ToString()!); Assert.Single(res6); Assert.Equal(return1QueryRecordString, res4.Single().ToString()); // handle ints var buildCommand7 = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", 5 } }); var expectedPreparedQuery7 = $"CYPHER a=5 {return1Query}"; - Assert.Equal(expectedPreparedQuery7,buildCommand7.Args[1].ToString()!); - var res7 = graph.Query("graph",buildCommand7.Args[1].ToString()!); + Assert.Equal(expectedPreparedQuery7, buildCommand7.Args[1].ToString()!); + var res7 = graph.Query("graph", buildCommand7.Args[1].ToString()!); Assert.Single(res7); Assert.Equal(return1QueryRecordString, res4.Single().ToString()); // handle quotes var buildCommand8 = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", "\"abc\"" } }); var expectedPreparedQuery8 = $"CYPHER a=\"\\\"abc\\\"\" {return1Query}"; - Assert.Equal(expectedPreparedQuery8,buildCommand8.Args[1].ToString()!); - var res8 = graph.Query("graph",buildCommand8.Args[1].ToString()!); + Assert.Equal(expectedPreparedQuery8, buildCommand8.Args[1].ToString()!); + var res8 = graph.Query("graph", buildCommand8.Args[1].ToString()!); Assert.Single(res8); Assert.Equal(return1QueryRecordString, res5.Single().ToString()); // handle backslashes var buildCommand9 = GraphCommandBuilder.Query("graph", return1Query, new Dictionary { { "a", "abc\\" } }); var expectedPreparedQuery9 = $"CYPHER a=\"abc\\\\\" {return1Query}"; - Assert.Equal(expectedPreparedQuery9,buildCommand9.Args[1].ToString()!); - var res9 = graph.Query("graph",buildCommand9.Args[1].ToString()!); + Assert.Equal(expectedPreparedQuery9, buildCommand9.Args[1].ToString()!); + var res9 = graph.Query("graph", buildCommand9.Args[1].ToString()!); Assert.Single(res9); Assert.Equal(return1QueryRecordString, res6.Single().ToString()); } From 819615476adc436d42450a1f20654680b3ede58f Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 6 Aug 2023 18:00:01 +0300 Subject: [PATCH 05/22] else if => elif --- .github/workflows/integration.yml | 2 +- tests/NRedisStack.Tests/Graph/GraphTests.cs | 64 +++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 12a4435e..0aa6b33e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,7 +48,7 @@ jobs: ls -R if [ "$REDIS_VERSION" != "edge" ]; then dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge - else if [ "$REDIS_VERSION" != "7.2.0-RC3" ]; then + elif [ "$REDIS_VERSION" != "7.2.0-RC3" ]; then dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=7.2.0-RC3 else dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index e2129aa9..abe4500a 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -21,6 +21,7 @@ public void Dispose() #region SyncTests [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -29,6 +30,7 @@ public void TestReserveBasic() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -52,6 +54,7 @@ public void TestCreateNode() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -73,6 +76,7 @@ public void TestCreateLabeledNode() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -100,6 +104,7 @@ public void TestConnectNodes() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -147,6 +152,7 @@ public void TestDeleteNodes() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -177,6 +183,7 @@ public void TestDeleteRelationship() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -204,6 +211,7 @@ public void TestIndex() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -235,6 +243,7 @@ public void TestHeader() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -360,6 +369,7 @@ public void TestRecord() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -440,6 +450,7 @@ record = iterator.Current; } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -459,6 +470,7 @@ public void TestEscapedQuery() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -559,6 +571,7 @@ record = iterator.Current; } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -611,6 +624,7 @@ public void TestPath() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -665,6 +679,7 @@ record = resultSet.Skip(1).First(); } [Fact] + [Trait("Category", "7.2.0-RC3")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -683,6 +698,7 @@ public void Test64BitNumber() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -714,6 +730,7 @@ public void TestCachedExecution() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -744,6 +761,7 @@ public void TestMapDataType() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -758,6 +776,7 @@ public void TestGeoPointLatLon() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -787,6 +806,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -799,6 +819,7 @@ public void TestPoint() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -813,6 +834,7 @@ public void timeoutArgument() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -846,6 +868,7 @@ public void TestCachedExecutionReadOnly() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -861,6 +884,7 @@ public void TestSimpleReadOnly() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -879,6 +903,7 @@ public void TestProfile() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -897,6 +922,7 @@ public void TestExplain() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -912,6 +938,7 @@ public void TestSlowlog() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -925,6 +952,7 @@ public void TestList() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -945,6 +973,7 @@ public void TestConfig() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -957,6 +986,7 @@ public void TestModulePrefixs() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -978,6 +1008,7 @@ public void TestCallProcedureDbLabels() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1004,6 +1035,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1012,6 +1044,7 @@ public async Task TestReserveBasicAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1035,6 +1068,7 @@ public async Task TestCreateNodeAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1056,6 +1090,7 @@ public async Task TestCreateLabeledNodeAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1084,6 +1119,7 @@ public async Task TestConnectNodesAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1131,6 +1167,7 @@ public async Task TestDeleteNodesAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1161,6 +1198,7 @@ public async Task TestDeleteRelationshipAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1188,6 +1226,7 @@ public async Task TestIndexAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1219,6 +1258,7 @@ public async Task TestHeaderAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1346,6 +1386,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1426,6 +1467,7 @@ record = iterator.Current; } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1445,6 +1487,7 @@ public async Task TestEscapedQueryAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1545,6 +1588,7 @@ record = iterator.Current; } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1597,6 +1641,7 @@ public async Task TestPathAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1651,6 +1696,7 @@ record = resultSet.Skip(1).First(); } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1669,6 +1715,7 @@ public async Task Test64bitnumberAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1700,6 +1747,7 @@ public async Task TestCachedExecutionAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1730,6 +1778,7 @@ public async Task TestMapDataTypeAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1744,6 +1793,7 @@ public async Task TestGeoPointLatLonAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1772,6 +1822,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1786,6 +1837,7 @@ public async Task timeoutArgumentAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1819,6 +1871,7 @@ public async Task TestCachedExecutionReadOnlyAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1834,6 +1887,7 @@ public async Task TestSimpleReadOnlyAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1852,6 +1906,7 @@ public async Task TestProfileAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1870,6 +1925,7 @@ public async Task TestExplainAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1885,6 +1941,7 @@ public async Task TestSlowlogAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1898,6 +1955,7 @@ public async Task TestListAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1918,6 +1976,7 @@ public async Task TestConfigAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1930,6 +1989,7 @@ public async Task TestModulePrefixsAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1951,6 +2011,7 @@ public async Task TestCallProcedureDbLabelsAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1973,6 +2034,7 @@ public async Task TestCallProcedureReadOnlyAsync() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1987,6 +2049,7 @@ public void TestParseInfinity() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2064,6 +2127,7 @@ public void TestEqualsAndToString() } [Fact] + [Trait("Category", "7.2.0-RC3")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; From d9547e33cf79b5c4043e8b7e617d531205cd0765 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 6 Aug 2023 18:06:02 +0300 Subject: [PATCH 06/22] elif => if --- .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 0aa6b33e..773898f1 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,7 +48,7 @@ jobs: ls -R if [ "$REDIS_VERSION" != "edge" ]; then dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge - elif [ "$REDIS_VERSION" != "7.2.0-RC3" ]; then + if [ "$REDIS_VERSION" != "7.2.0-RC3" ]; then dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=7.2.0-RC3 else dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover From 1159216cad0a8eea0b532f92a3f41bb97cd87f8c Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 6 Aug 2023 18:09:30 +0300 Subject: [PATCH 07/22] elif --- .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 773898f1..0aa6b33e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,7 +48,7 @@ jobs: ls -R if [ "$REDIS_VERSION" != "edge" ]; then dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge - if [ "$REDIS_VERSION" != "7.2.0-RC3" ]; then + elif [ "$REDIS_VERSION" != "7.2.0-RC3" ]; then dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=7.2.0-RC3 else dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover From 3a64860a8b169a21ea50c4b381e24dd9f3266b84 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 6 Aug 2023 18:32:51 +0300 Subject: [PATCH 08/22] Try somthing --- .github/workflows/integration.yml | 10 +- tests/NRedisStack.Tests/Gears/GearsTests.cs | 14 +-- tests/NRedisStack.Tests/Graph/GraphTests.cs | 128 ++++++++++---------- tests/NRedisStack.Tests/Json/JsonTests.cs | 8 +- 4 files changed, 80 insertions(+), 80 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 0aa6b33e..c399fb68 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -47,9 +47,9 @@ jobs: echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net6.0/redis_user_private.key ls -R if [ "$REDIS_VERSION" != "edge" ]; then - dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge - elif [ "$REDIS_VERSION" != "7.2.0-RC3" ]; then - dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=7.2.0-RC3 + dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter RunOnlyOnThisVersion!=edge + elif [ "$REDIS_VERSION" == "7.2.0-RC3" ]; then + dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter SkipIfThisIsTheVersoin!=7.2.0-RC3 else dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover fi @@ -60,7 +60,7 @@ jobs: echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_user_private.key ls -R if [ "$REDIS_VERSION" != "edge" ]; then - dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge + dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter RunOnlyOnThisVersion!=edge else dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover fi @@ -107,4 +107,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 --filter Category!=edge + dotnet test -f net481 --no-build --verbosity normal --filter RunOnlyOnThisVersion!=edge diff --git a/tests/NRedisStack.Tests/Gears/GearsTests.cs b/tests/NRedisStack.Tests/Gears/GearsTests.cs index 79d7f7ae..429658f1 100644 --- a/tests/NRedisStack.Tests/Gears/GearsTests.cs +++ b/tests/NRedisStack.Tests/Gears/GearsTests.cs @@ -17,7 +17,7 @@ public void Dispose() [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public void TestTFunctionLoadDelete() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -28,7 +28,7 @@ public void TestTFunctionLoadDelete() [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public async Task TestTFunctionLoadDeleteAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -40,7 +40,7 @@ public async Task TestTFunctionLoadDeleteAsync() } [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public void TestTFunctionList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -72,7 +72,7 @@ public void TestTFunctionList() } [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public async Task TestTFunctionListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -102,7 +102,7 @@ public async Task TestTFunctionListAsync() } [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public void TestTFCall() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -117,7 +117,7 @@ public void TestTFCall() } [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public async Task TestTFCallAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -132,7 +132,7 @@ public async Task TestTFCallAsync() } [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public void TestGearsCommandBuilder() { // TFunctionLoad: diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index abe4500a..a0729346 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -21,7 +21,7 @@ public void Dispose() #region SyncTests [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -30,7 +30,7 @@ public void TestReserveBasic() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -54,7 +54,7 @@ public void TestCreateNode() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -76,7 +76,7 @@ public void TestCreateLabeledNode() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -104,7 +104,7 @@ public void TestConnectNodes() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -152,7 +152,7 @@ public void TestDeleteNodes() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -183,7 +183,7 @@ public void TestDeleteRelationship() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -211,7 +211,7 @@ public void TestIndex() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -243,7 +243,7 @@ public void TestHeader() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -369,7 +369,7 @@ public void TestRecord() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -450,7 +450,7 @@ record = iterator.Current; } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -470,7 +470,7 @@ public void TestEscapedQuery() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -571,7 +571,7 @@ record = iterator.Current; } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -624,7 +624,7 @@ public void TestPath() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -679,7 +679,7 @@ record = resultSet.Skip(1).First(); } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -698,7 +698,7 @@ public void Test64BitNumber() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -730,7 +730,7 @@ public void TestCachedExecution() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -761,7 +761,7 @@ public void TestMapDataType() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -776,7 +776,7 @@ public void TestGeoPointLatLon() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -806,7 +806,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -819,7 +819,7 @@ public void TestPoint() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -834,7 +834,7 @@ public void timeoutArgument() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -868,7 +868,7 @@ public void TestCachedExecutionReadOnly() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -884,7 +884,7 @@ public void TestSimpleReadOnly() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -903,7 +903,7 @@ public void TestProfile() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -922,7 +922,7 @@ public void TestExplain() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -938,7 +938,7 @@ public void TestSlowlog() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -952,7 +952,7 @@ public void TestList() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -973,7 +973,7 @@ public void TestConfig() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -986,7 +986,7 @@ public void TestModulePrefixs() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -1008,7 +1008,7 @@ public void TestCallProcedureDbLabels() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1035,7 +1035,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1044,7 +1044,7 @@ public async Task TestReserveBasicAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1068,7 +1068,7 @@ public async Task TestCreateNodeAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1090,7 +1090,7 @@ public async Task TestCreateLabeledNodeAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1119,7 +1119,7 @@ public async Task TestConnectNodesAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1167,7 +1167,7 @@ public async Task TestDeleteNodesAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1198,7 +1198,7 @@ public async Task TestDeleteRelationshipAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1226,7 +1226,7 @@ public async Task TestIndexAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1258,7 +1258,7 @@ public async Task TestHeaderAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1386,7 +1386,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1467,7 +1467,7 @@ record = iterator.Current; } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1487,7 +1487,7 @@ public async Task TestEscapedQueryAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1588,7 +1588,7 @@ record = iterator.Current; } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1641,7 +1641,7 @@ public async Task TestPathAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1696,7 +1696,7 @@ record = resultSet.Skip(1).First(); } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1715,7 +1715,7 @@ public async Task Test64bitnumberAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1747,7 +1747,7 @@ public async Task TestCachedExecutionAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1778,7 +1778,7 @@ public async Task TestMapDataTypeAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1793,7 +1793,7 @@ public async Task TestGeoPointLatLonAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1822,7 +1822,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1837,7 +1837,7 @@ public async Task timeoutArgumentAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1871,7 +1871,7 @@ public async Task TestCachedExecutionReadOnlyAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1887,7 +1887,7 @@ public async Task TestSimpleReadOnlyAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1906,7 +1906,7 @@ public async Task TestProfileAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1925,7 +1925,7 @@ public async Task TestExplainAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1941,7 +1941,7 @@ public async Task TestSlowlogAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1955,7 +1955,7 @@ public async Task TestListAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1976,7 +1976,7 @@ public async Task TestConfigAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1989,7 +1989,7 @@ public async Task TestModulePrefixsAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -2011,7 +2011,7 @@ public async Task TestCallProcedureDbLabelsAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -2034,7 +2034,7 @@ public async Task TestCallProcedureReadOnlyAsync() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2049,7 +2049,7 @@ public void TestParseInfinity() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2127,7 +2127,7 @@ public void TestEqualsAndToString() } [Fact] - [Trait("Category", "7.2.0-RC3")] + [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; diff --git a/tests/NRedisStack.Tests/Json/JsonTests.cs b/tests/NRedisStack.Tests/Json/JsonTests.cs index f437af67..c6555147 100644 --- a/tests/NRedisStack.Tests/Json/JsonTests.cs +++ b/tests/NRedisStack.Tests/Json/JsonTests.cs @@ -704,7 +704,7 @@ public async Task GetAsync() } [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public void MSet() { IJsonCommands commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -729,7 +729,7 @@ public void MSet() } [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public async Task MSetAsync() { IJsonCommandsAsync commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -753,7 +753,7 @@ await commands.MSetAsync(values) } [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public void Merge() { // Create a connection to Redis @@ -773,7 +773,7 @@ public void Merge() } [Fact] - [Trait("Category", "edge")] + [Trait("RunOnlyOnThisVersion", "edge")] public async Task MergeAsync() { // Create a connection to Redis From ae0fdbdfcf97882a3a8b1370c82101055a6e8539 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 6 Aug 2023 18:36:58 +0300 Subject: [PATCH 09/22] try --- .github/workflows/integration.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index c399fb68..82611bdb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -61,6 +61,8 @@ jobs: ls -R if [ "$REDIS_VERSION" != "edge" ]; then dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter RunOnlyOnThisVersion!=edge + elif [ "$REDIS_VERSION" == "7.2.0-RC3" ]; then + dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter SkipIfThisIsTheVersoin!=7.2.0-RC3 else dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover fi From 77276d7c10ebd612433d4dda5ec11ac813d88187 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 6 Aug 2023 19:01:46 +0300 Subject: [PATCH 10/22] try to fix contitions --- .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 82611bdb..f4546b7e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -59,7 +59,7 @@ jobs: echo "${{secrets.REDIS_USER_CRT}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_user.crt echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_user_private.key ls -R - if [ "$REDIS_VERSION" != "edge" ]; then + if [ "$REDIS_VERSION" != "edge" && "$REDIS_VERSION" != "7.2.0-RC3"]; then dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter RunOnlyOnThisVersion!=edge elif [ "$REDIS_VERSION" == "7.2.0-RC3" ]; then dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter SkipIfThisIsTheVersoin!=7.2.0-RC3 From 96dde55523b4d60f4e1ee29a5a53fbb871224ba4 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Tue, 8 Aug 2023 09:01:45 +0300 Subject: [PATCH 11/22] lessSkipAttr --- .../SkipIfServerLessThanAttribute.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/NRedisStack.Tests/SkipIfServerLessThanAttribute.cs diff --git a/tests/NRedisStack.Tests/SkipIfServerLessThanAttribute.cs b/tests/NRedisStack.Tests/SkipIfServerLessThanAttribute.cs new file mode 100644 index 00000000..44d81e36 --- /dev/null +++ b/tests/NRedisStack.Tests/SkipIfServerLessThanAttribute.cs @@ -0,0 +1,34 @@ +using System; +using Xunit; +using Xunit.Sdk; +using StackExchange.Redis; + +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +public class SkipIfRedisVersionLessThanAttribute : FactAttribute +{ + private readonly string _minVersion; + private string DefaultRedisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; + + public SkipIfRedisVersionLessThanAttribute(string minVersion) + { + _minVersion = minVersion; + } + + public override string Skip + { + get + { + using (var connection = ConnectionMultiplexer.Connect(DefaultRedisConnectionString)) + { + var serverVersion = connection.GetServer(connection.GetEndPoints()[0]).Version; + + if (serverVersion < new Version(_minVersion)) + { + return $"Test skipped because Redis server version ({serverVersion}) is less than {_minVersion}."; + } + + return null; + } + } + } +} From e272e5863728cf9d6b33f851d695f49ce87bf9a2 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Tue, 8 Aug 2023 14:10:34 +0300 Subject: [PATCH 12/22] WIP --- .../AbstractNRedisStackTest.cs | 2 ++ tests/NRedisStack.Tests/RedisFixture.cs | 23 +++++++++++++ ...kipIfServerVersionGreaterThanAttribute.cs} | 12 +++---- .../SkipIfServerVersionLessThanAttribute.cs | 32 +++++++++++++++++++ 4 files changed, 62 insertions(+), 7 deletions(-) rename tests/NRedisStack.Tests/{SkipIfServerLessThanAttribute.cs => SkipIfServerVersionGreaterThanAttribute.cs} (67%) create mode 100644 tests/NRedisStack.Tests/SkipIfServerVersionLessThanAttribute.cs diff --git a/tests/NRedisStack.Tests/AbstractNRedisStackTest.cs b/tests/NRedisStack.Tests/AbstractNRedisStackTest.cs index b84d259a..9e0e4c50 100644 --- a/tests/NRedisStack.Tests/AbstractNRedisStackTest.cs +++ b/tests/NRedisStack.Tests/AbstractNRedisStackTest.cs @@ -7,6 +7,8 @@ namespace NRedisStack.Tests { public abstract class AbstractNRedisStackTest : IClassFixture, IAsyncLifetime { + public Version ServerVersion => redisFixture.ServerVersion; + protected internal RedisFixture redisFixture; protected internal AbstractNRedisStackTest(RedisFixture redisFixture) => this.redisFixture = redisFixture; diff --git a/tests/NRedisStack.Tests/RedisFixture.cs b/tests/NRedisStack.Tests/RedisFixture.cs index 8ae470f2..db6201b0 100644 --- a/tests/NRedisStack.Tests/RedisFixture.cs +++ b/tests/NRedisStack.Tests/RedisFixture.cs @@ -16,5 +16,28 @@ public void Dispose() } public ConnectionMultiplexer Redis { get; private set; } + + public Version ServerVersion => Redis.GetServer(redis).Version; + + + public string? SkipIfServerLessThan(string minVersion) + { + if (ServerVersion < new Version(minVersion)) + { + return $"Test skipped because Redis server version ({ServerVersion}) is less than {minVersion}."; + } + + return null; + } + + public string? SkipIfServerGreaterThan(string maxVersion) + { + if (ServerVersion > new Version(maxVersion)) + { + return $"Test skipped because Redis server version ({ServerVersion}) is greater than {maxVersion}."; + } + + return null; + } } } \ No newline at end of file diff --git a/tests/NRedisStack.Tests/SkipIfServerLessThanAttribute.cs b/tests/NRedisStack.Tests/SkipIfServerVersionGreaterThanAttribute.cs similarity index 67% rename from tests/NRedisStack.Tests/SkipIfServerLessThanAttribute.cs rename to tests/NRedisStack.Tests/SkipIfServerVersionGreaterThanAttribute.cs index 44d81e36..4db43421 100644 --- a/tests/NRedisStack.Tests/SkipIfServerLessThanAttribute.cs +++ b/tests/NRedisStack.Tests/SkipIfServerVersionGreaterThanAttribute.cs @@ -1,15 +1,13 @@ -using System; using Xunit; -using Xunit.Sdk; using StackExchange.Redis; [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] -public class SkipIfRedisVersionLessThanAttribute : FactAttribute +public class SkipIfRedisVersionGteAttribute : FactAttribute { private readonly string _minVersion; - private string DefaultRedisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; + private readonly string DefaultRedisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; - public SkipIfRedisVersionLessThanAttribute(string minVersion) + public SkipIfRedisVersionGteAttribute(string minVersion) { _minVersion = minVersion; } @@ -24,11 +22,11 @@ public override string Skip if (serverVersion < new Version(_minVersion)) { - return $"Test skipped because Redis server version ({serverVersion}) is less than {_minVersion}."; + return $"Test skipped because Redis server version ({serverVersion}) is >= {_minVersion}."; } return null; } } } -} +} \ No newline at end of file diff --git a/tests/NRedisStack.Tests/SkipIfServerVersionLessThanAttribute.cs b/tests/NRedisStack.Tests/SkipIfServerVersionLessThanAttribute.cs new file mode 100644 index 00000000..a00a2f3b --- /dev/null +++ b/tests/NRedisStack.Tests/SkipIfServerVersionLessThanAttribute.cs @@ -0,0 +1,32 @@ +using Xunit; +using StackExchange.Redis; + +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +public class SkipIfRedisVersionLtAttribute : FactAttribute +{ + private readonly string _minVersion; + private readonly string DefaultRedisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; + + public SkipIfRedisVersionLtAttribute(string minVersion) + { + _minVersion = minVersion; + } + + public override string Skip + { + get + { + using (var connection = ConnectionMultiplexer.Connect(DefaultRedisConnectionString)) + { + var serverVersion = connection.GetServer(connection.GetEndPoints()[0]).Version; + + if (serverVersion < new Version(_minVersion)) + { + return $"Test skipped because Redis server version ({serverVersion}) is < {_minVersion}."; + } + + return null; + } + } + } +} \ No newline at end of file From ce6d9008c6e02756bbc2ccec5e5e060db127afc0 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Wed, 9 Aug 2023 14:22:09 +0300 Subject: [PATCH 13/22] Try to use SkipIfRedisVersionLt Attribute --- tests/NRedisStack.Tests/Graph/GraphTests.cs | 199 +++++++------------- 1 file changed, 71 insertions(+), 128 deletions(-) diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index a0729346..ee2ef57c 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -20,19 +20,19 @@ public void Dispose() #region SyncTests - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestReserveBasic() { + Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestCreateNode() { + Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -53,10 +53,10 @@ public void TestCreateNode() graph.Delete("social"); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestCreateLabeledNode() { + Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -75,10 +75,10 @@ public void TestCreateLabeledNode() // Assert.False(resultSet..iterator().MoveNext()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestConnectNodes() { + Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -103,10 +103,10 @@ public void TestConnectNodes() Assert.Equal(0, resultSet.Count); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestDeleteNodes() { + Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -151,8 +151,7 @@ public void TestDeleteNodes() // Assert.False(deleteResult.iterator().MoveNext()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -182,10 +181,10 @@ public void TestDeleteRelationship() // Assert.False(deleteResult.iterator().MoveNext()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestIndex() { + Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -210,8 +209,7 @@ public void TestIndex() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -242,8 +240,8 @@ public void TestHeader() Assert.Equal("a.age", schemaNames[2]); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] + // [Trait("SkipIfThisIsTheVersoin", "7.2.0")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -368,8 +366,7 @@ public void TestRecord() } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -449,8 +446,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -469,8 +465,7 @@ public void TestEscapedQuery() Assert.NotNull(graph.Query("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -570,8 +565,7 @@ record = iterator.Current; } } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -623,8 +617,7 @@ public void TestPath() } } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -678,8 +671,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -697,8 +689,7 @@ public void Test64BitNumber() } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -729,8 +720,7 @@ public void TestCachedExecution() Assert.True(resultSet.Statistics.CachedExecution); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -760,8 +750,7 @@ public void TestMapDataType() Assert.Equal((object)expected, actual); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -775,8 +764,7 @@ public void TestGeoPointLatLon() AssertTestGeoPoint(graph); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -805,8 +793,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) Assert.Equal((object)(point), property); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -818,8 +805,7 @@ public void TestPoint() Assert.Throws(() => new Point(new List { 1, 2, 3 })); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -833,8 +819,7 @@ public void timeoutArgument() Assert.Equal(100l, (long)r.Values[0]); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -867,8 +852,7 @@ public void TestCachedExecutionReadOnly() Assert.True(resultSet.Statistics.CachedExecution); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -883,8 +867,7 @@ public void TestSimpleReadOnly() Assert.Equal("30", r.Values[0].ToString()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -902,8 +885,7 @@ public void TestProfile() } } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -921,8 +903,7 @@ public void TestExplain() } } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -937,8 +918,7 @@ public void TestSlowlog() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -951,8 +931,7 @@ public void TestList() Assert.Equal(new List() { "social" }, graph.List()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -972,8 +951,7 @@ public void TestConfig() graph.ConfigSet(name, existingValue != null ? existingValue.ToString() : -1); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -985,8 +963,7 @@ public void TestModulePrefixs() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -1007,8 +984,7 @@ public void TestCallProcedureDbLabels() Assert.Single(labels1); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1034,8 +1010,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1043,8 +1018,7 @@ public async Task TestReserveBasicAsync() var graph = db.GRAPH(); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1067,8 +1041,7 @@ public async Task TestCreateNodeAsync() await graph.DeleteAsync("social"); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1089,8 +1062,7 @@ public async Task TestCreateLabeledNodeAsync() // Assert.False(resultSet..iterator().MoveNext()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1118,8 +1090,7 @@ public async Task TestConnectNodesAsync() // Assert.False(resultSet.GetEnumerator().MoveNext()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1166,8 +1137,7 @@ public async Task TestDeleteNodesAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1197,8 +1167,7 @@ public async Task TestDeleteRelationshipAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1225,8 +1194,7 @@ public async Task TestIndexAsync() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1257,8 +1225,7 @@ public async Task TestHeaderAsync() Assert.Equal("a.age", schemaNames[2]); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1385,8 +1352,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1466,8 +1432,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1486,8 +1451,7 @@ public async Task TestEscapedQueryAsync() Assert.NotNull(await graph.QueryAsync("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1587,8 +1551,7 @@ record = iterator.Current; } } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1640,8 +1603,7 @@ public async Task TestPathAsync() } } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1695,8 +1657,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1714,8 +1675,7 @@ public async Task Test64bitnumberAsync() } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1746,8 +1706,7 @@ public async Task TestCachedExecutionAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1777,8 +1736,7 @@ public async Task TestMapDataTypeAsync() Assert.Equal((object)expected, actual); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1792,8 +1750,7 @@ public async Task TestGeoPointLatLonAsync() AssertTestGeoPoint(graph); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1821,8 +1778,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) Assert.Equal((object)(new Point(30.27822306, -97.75134723)), property); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1836,8 +1792,7 @@ public async Task timeoutArgumentAsync() Assert.Equal(100l, (long)r.Values[0]); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1870,8 +1825,7 @@ public async Task TestCachedExecutionReadOnlyAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1886,8 +1840,7 @@ public async Task TestSimpleReadOnlyAsync() Assert.Equal("30", r.Values[0].ToString()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1905,8 +1858,7 @@ public async Task TestProfileAsync() } } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1924,8 +1876,7 @@ public async Task TestExplainAsync() } } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1940,8 +1891,7 @@ public async Task TestSlowlogAsync() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1954,8 +1904,7 @@ public async Task TestListAsync() Assert.Equal(new List() { "social" }, await graph.ListAsync()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1975,8 +1924,7 @@ public async Task TestConfigAsync() await graph.ConfigSetAsync(name, existingValue != null ? existingValue.ToString() : -1); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1988,8 +1936,7 @@ public async Task TestModulePrefixsAsync() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -2010,8 +1957,7 @@ public async Task TestCallProcedureDbLabelsAsync() Assert.Single(labels1); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -2033,8 +1979,7 @@ public async Task TestCallProcedureReadOnlyAsync() await Assert.ThrowsAsync(() => graph.CallProcedureAsync(graphName, "db.idx.fulltext.createNodeIndex", procedureArgs, ProcedureMode.Read)); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2048,8 +1993,7 @@ public void TestParseInfinity() Assert.Equal(double.PositiveInfinity, r.Values[0]); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2126,8 +2070,7 @@ public void TestEqualsAndToString() Assert.Equal(expectedPathString, pathString); } - [Fact] - [Trait("SkipIfThisIsTheVersoin", "7.2.0-RC3")] + [SkipIfRedisVersionLt("7.2.0")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; From 826afe676ad2d9f4e57ecabed33e9a48bdb5e379 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Wed, 9 Aug 2023 14:29:53 +0300 Subject: [PATCH 14/22] go back --- .github/workflows/integration.yml | 12 ++++-------- tests/NRedisStack.Tests/Gears/GearsTests.cs | 14 +++++++------- tests/NRedisStack.Tests/Graph/GraphTests.cs | 7 ------- tests/NRedisStack.Tests/Json/JsonTests.cs | 8 ++++---- tests/NRedisStack.Tests/RedisFixture.cs | 21 --------------------- 5 files changed, 15 insertions(+), 47 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index f4546b7e..299fe5ef 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -47,9 +47,7 @@ jobs: echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net6.0/redis_user_private.key ls -R if [ "$REDIS_VERSION" != "edge" ]; then - dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter RunOnlyOnThisVersion!=edge - elif [ "$REDIS_VERSION" == "7.2.0-RC3" ]; then - dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter SkipIfThisIsTheVersoin!=7.2.0-RC3 + dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge else dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover fi @@ -59,10 +57,8 @@ jobs: echo "${{secrets.REDIS_USER_CRT}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_user.crt echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_user_private.key ls -R - if [ "$REDIS_VERSION" != "edge" && "$REDIS_VERSION" != "7.2.0-RC3"]; then - dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter RunOnlyOnThisVersion!=edge - elif [ "$REDIS_VERSION" == "7.2.0-RC3" ]; then - dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter SkipIfThisIsTheVersoin!=7.2.0-RC3 + if [ "$REDIS_VERSION" != "edge" ]; then + dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge else dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover fi @@ -109,4 +105,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 --filter RunOnlyOnThisVersion!=edge + dotnet test -f net481 --no-build --verbosity normal --filter Category!=edge diff --git a/tests/NRedisStack.Tests/Gears/GearsTests.cs b/tests/NRedisStack.Tests/Gears/GearsTests.cs index 429658f1..79d7f7ae 100644 --- a/tests/NRedisStack.Tests/Gears/GearsTests.cs +++ b/tests/NRedisStack.Tests/Gears/GearsTests.cs @@ -17,7 +17,7 @@ public void Dispose() [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public void TestTFunctionLoadDelete() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -28,7 +28,7 @@ public void TestTFunctionLoadDelete() [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public async Task TestTFunctionLoadDeleteAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -40,7 +40,7 @@ public async Task TestTFunctionLoadDeleteAsync() } [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public void TestTFunctionList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -72,7 +72,7 @@ public void TestTFunctionList() } [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public async Task TestTFunctionListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -102,7 +102,7 @@ public async Task TestTFunctionListAsync() } [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public void TestTFCall() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -117,7 +117,7 @@ public void TestTFCall() } [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public async Task TestTFCallAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -132,7 +132,7 @@ public async Task TestTFCallAsync() } [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public void TestGearsCommandBuilder() { // TFunctionLoad: diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index ee2ef57c..bedfa2cd 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -23,7 +23,6 @@ public void Dispose() [SkipIfRedisVersionLt("7.2.0")] public void TestReserveBasic() { - Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -32,7 +31,6 @@ public void TestReserveBasic() [SkipIfRedisVersionLt("7.2.0")] public void TestCreateNode() { - Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -56,7 +54,6 @@ public void TestCreateNode() [SkipIfRedisVersionLt("7.2.0")] public void TestCreateLabeledNode() { - Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -78,7 +75,6 @@ public void TestCreateLabeledNode() [SkipIfRedisVersionLt("7.2.0")] public void TestConnectNodes() { - Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -106,7 +102,6 @@ public void TestConnectNodes() [SkipIfRedisVersionLt("7.2.0")] public void TestDeleteNodes() { - Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -184,7 +179,6 @@ public void TestDeleteRelationship() [SkipIfRedisVersionLt("7.2.0")] public void TestIndex() { - Skip.IfServerLessThan(ServerVersion, "7.2.0"); IDatabase db = redisFixture.Redis.GetDatabase(); db.Execute("FLUSHALL"); var graph = db.GRAPH(); @@ -241,7 +235,6 @@ public void TestHeader() } [SkipIfRedisVersionLt("7.2.0")] - // [Trait("SkipIfThisIsTheVersoin", "7.2.0")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/Json/JsonTests.cs b/tests/NRedisStack.Tests/Json/JsonTests.cs index c6555147..f437af67 100644 --- a/tests/NRedisStack.Tests/Json/JsonTests.cs +++ b/tests/NRedisStack.Tests/Json/JsonTests.cs @@ -704,7 +704,7 @@ public async Task GetAsync() } [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public void MSet() { IJsonCommands commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -729,7 +729,7 @@ public void MSet() } [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public async Task MSetAsync() { IJsonCommandsAsync commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -753,7 +753,7 @@ await commands.MSetAsync(values) } [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public void Merge() { // Create a connection to Redis @@ -773,7 +773,7 @@ public void Merge() } [Fact] - [Trait("RunOnlyOnThisVersion", "edge")] + [Trait("Category", "edge")] public async Task MergeAsync() { // Create a connection to Redis diff --git a/tests/NRedisStack.Tests/RedisFixture.cs b/tests/NRedisStack.Tests/RedisFixture.cs index db6201b0..28514c5c 100644 --- a/tests/NRedisStack.Tests/RedisFixture.cs +++ b/tests/NRedisStack.Tests/RedisFixture.cs @@ -18,26 +18,5 @@ public void Dispose() public ConnectionMultiplexer Redis { get; private set; } public Version ServerVersion => Redis.GetServer(redis).Version; - - - public string? SkipIfServerLessThan(string minVersion) - { - if (ServerVersion < new Version(minVersion)) - { - return $"Test skipped because Redis server version ({ServerVersion}) is less than {minVersion}."; - } - - return null; - } - - public string? SkipIfServerGreaterThan(string maxVersion) - { - if (ServerVersion > new Version(maxVersion)) - { - return $"Test skipped because Redis server version ({ServerVersion}) is greater than {maxVersion}."; - } - - return null; - } } } \ No newline at end of file From 4e149b29b8b6228b6f4667f3871542f2eb227a0f Mon Sep 17 00:00:00 2001 From: shacharPash Date: Wed, 9 Aug 2023 14:43:51 +0300 Subject: [PATCH 15/22] fixes of places with graph --- tests/NRedisStack.Tests/Graph/GraphTests.cs | 128 +++++++++--------- tests/NRedisStack.Tests/PipelineTests.cs | 49 ++++++- ...SkipIfServerVersionGreaterThanAttribute.cs | 2 +- tests/NRedisStack.Tests/TransactionsTests.cs | 49 ++++++- 4 files changed, 161 insertions(+), 67 deletions(-) diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index bedfa2cd..a43f8a09 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -20,7 +20,7 @@ public void Dispose() #region SyncTests - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -28,7 +28,7 @@ public void TestReserveBasic() var graph = db.GRAPH(); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -51,7 +51,7 @@ public void TestCreateNode() graph.Delete("social"); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -72,7 +72,7 @@ public void TestCreateLabeledNode() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -99,7 +99,7 @@ public void TestConnectNodes() Assert.Equal(0, resultSet.Count); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -146,7 +146,7 @@ public void TestDeleteNodes() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -176,7 +176,7 @@ public void TestDeleteRelationship() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -203,7 +203,7 @@ public void TestIndex() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -234,7 +234,7 @@ public void TestHeader() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -359,7 +359,7 @@ public void TestRecord() } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -439,7 +439,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -458,7 +458,7 @@ public void TestEscapedQuery() Assert.NotNull(graph.Query("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -558,7 +558,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -610,7 +610,7 @@ public void TestPath() } } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -664,7 +664,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -682,7 +682,7 @@ public void Test64BitNumber() } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -713,7 +713,7 @@ public void TestCachedExecution() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -743,7 +743,7 @@ public void TestMapDataType() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -757,7 +757,7 @@ public void TestGeoPointLatLon() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -786,7 +786,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) Assert.Equal((object)(point), property); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -798,7 +798,7 @@ public void TestPoint() Assert.Throws(() => new Point(new List { 1, 2, 3 })); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -812,7 +812,7 @@ public void timeoutArgument() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -845,7 +845,7 @@ public void TestCachedExecutionReadOnly() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -860,7 +860,7 @@ public void TestSimpleReadOnly() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -878,7 +878,7 @@ public void TestProfile() } } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -896,7 +896,7 @@ public void TestExplain() } } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -911,7 +911,7 @@ public void TestSlowlog() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -924,7 +924,7 @@ public void TestList() Assert.Equal(new List() { "social" }, graph.List()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -944,7 +944,7 @@ public void TestConfig() graph.ConfigSet(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -956,7 +956,7 @@ public void TestModulePrefixs() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -977,7 +977,7 @@ public void TestCallProcedureDbLabels() Assert.Single(labels1); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1003,7 +1003,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1011,7 +1011,7 @@ public async Task TestReserveBasicAsync() var graph = db.GRAPH(); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1034,7 +1034,7 @@ public async Task TestCreateNodeAsync() await graph.DeleteAsync("social"); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1055,7 +1055,7 @@ public async Task TestCreateLabeledNodeAsync() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1083,7 +1083,7 @@ public async Task TestConnectNodesAsync() // Assert.False(resultSet.GetEnumerator().MoveNext()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1130,7 +1130,7 @@ public async Task TestDeleteNodesAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1160,7 +1160,7 @@ public async Task TestDeleteRelationshipAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1187,7 +1187,7 @@ public async Task TestIndexAsync() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1218,7 +1218,7 @@ public async Task TestHeaderAsync() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1345,7 +1345,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1425,7 +1425,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1444,7 +1444,7 @@ public async Task TestEscapedQueryAsync() Assert.NotNull(await graph.QueryAsync("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1544,7 +1544,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1596,7 +1596,7 @@ public async Task TestPathAsync() } } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1650,7 +1650,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1668,7 +1668,7 @@ public async Task Test64bitnumberAsync() } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1699,7 +1699,7 @@ public async Task TestCachedExecutionAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1729,7 +1729,7 @@ public async Task TestMapDataTypeAsync() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1743,7 +1743,7 @@ public async Task TestGeoPointLatLonAsync() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1771,7 +1771,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) Assert.Equal((object)(new Point(30.27822306, -97.75134723)), property); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1785,7 +1785,7 @@ public async Task timeoutArgumentAsync() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1818,7 +1818,7 @@ public async Task TestCachedExecutionReadOnlyAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1833,7 +1833,7 @@ public async Task TestSimpleReadOnlyAsync() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1851,7 +1851,7 @@ public async Task TestProfileAsync() } } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1869,7 +1869,7 @@ public async Task TestExplainAsync() } } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1884,7 +1884,7 @@ public async Task TestSlowlogAsync() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1897,7 +1897,7 @@ public async Task TestListAsync() Assert.Equal(new List() { "social" }, await graph.ListAsync()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1917,7 +1917,7 @@ public async Task TestConfigAsync() await graph.ConfigSetAsync(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1929,7 +1929,7 @@ public async Task TestModulePrefixsAsync() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1950,7 +1950,7 @@ public async Task TestCallProcedureDbLabelsAsync() Assert.Single(labels1); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1972,7 +1972,7 @@ public async Task TestCallProcedureReadOnlyAsync() await Assert.ThrowsAsync(() => graph.CallProcedureAsync(graphName, "db.idx.fulltext.createNodeIndex", procedureArgs, ProcedureMode.Read)); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1986,7 +1986,7 @@ public void TestParseInfinity() Assert.Equal(double.PositiveInfinity, r.Values[0]); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2063,7 +2063,7 @@ public void TestEqualsAndToString() Assert.Equal(expectedPathString, pathString); } - [SkipIfRedisVersionLt("7.2.0")] + [SkipIfRedisVersionGte("7.2.0")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; diff --git a/tests/NRedisStack.Tests/PipelineTests.cs b/tests/NRedisStack.Tests/PipelineTests.cs index 8eba3289..ee7de833 100644 --- a/tests/NRedisStack.Tests/PipelineTests.cs +++ b/tests/NRedisStack.Tests/PipelineTests.cs @@ -18,7 +18,7 @@ public void Dispose() redisFixture.Redis.GetDatabase().KeyDelete(key); } - [Fact] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestModulsPipeline() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -69,6 +69,53 @@ public async Task TestModulsPipeline() Assert.NotNull(db.TOPK().Info("topk-key")); } + [Fact] + public async Task TestModulsPipelineWithotGraph() + { + IDatabase db = redisFixture.Redis.GetDatabase(); + db.Execute("FLUSHALL"); + var pipeline = new Pipeline(db); + + pipeline.Bf.ReserveAsync("bf-key", 0.001, 100); + pipeline.Bf.AddAsync("bf-key", "1"); + pipeline.Cms.InitByDimAsync("cms-key", 100, 5); + pipeline.Cf.ReserveAsync("cf-key", 100); + pipeline.Json.SetAsync("json-key", "$", "{}"); + pipeline.Ft.CreateAsync("ft-key", new FTCreateParams(), new Schema().AddTextField("txt")); + pipeline.Tdigest.CreateAsync("tdigest-key", 100); + pipeline.Ts.CreateAsync("ts-key", 100); + pipeline.TopK.ReserveAsync("topk-key", 100, 100, 100); + + Assert.False(db.KeyExists("bf-key")); + Assert.False(db.KeyExists("cms-key")); + Assert.False(db.KeyExists("cf-key")); + Assert.False(db.KeyExists("json-key")); + Assert.Equal(0, db.FT()._List().Length); + Assert.False(db.KeyExists("tdigest-key")); + Assert.False(db.KeyExists("ts-key")); + Assert.False(db.KeyExists("topk-key")); + + pipeline.Execute(); + + Assert.True(db.KeyExists("bf-key")); + Assert.True(db.KeyExists("cms-key")); + Assert.True(db.KeyExists("cf-key")); + Assert.True(db.KeyExists("json-key")); + Assert.True(db.FT()._List().Length == 1); + Assert.True(db.KeyExists("tdigest-key")); + Assert.True(db.KeyExists("ts-key")); + Assert.True(db.KeyExists("topk-key")); + + Assert.True(db.BF().Exists("bf-key", "1")); + Assert.True(db.CMS().Info("cms-key").Width == 100); + Assert.True(db.CF().Info("cf-key").Size > 0); + Assert.False(db.JSON().Get("json-key").IsNull); + Assert.NotNull(db.FT().Info("ft-key")); + Assert.NotNull(db.TDIGEST().Info("tdigest-key")); + Assert.NotNull(db.TS().Info("ts-key")); + Assert.NotNull(db.TOPK().Info("topk-key")); + } + [Fact] public async Task TestBloomPipeline() { diff --git a/tests/NRedisStack.Tests/SkipIfServerVersionGreaterThanAttribute.cs b/tests/NRedisStack.Tests/SkipIfServerVersionGreaterThanAttribute.cs index 4db43421..85d44ade 100644 --- a/tests/NRedisStack.Tests/SkipIfServerVersionGreaterThanAttribute.cs +++ b/tests/NRedisStack.Tests/SkipIfServerVersionGreaterThanAttribute.cs @@ -20,7 +20,7 @@ public override string Skip { var serverVersion = connection.GetServer(connection.GetEndPoints()[0]).Version; - if (serverVersion < new Version(_minVersion)) + if (serverVersion >= new Version(_minVersion)) { return $"Test skipped because Redis server version ({serverVersion}) is >= {_minVersion}."; } diff --git a/tests/NRedisStack.Tests/TransactionsTests.cs b/tests/NRedisStack.Tests/TransactionsTests.cs index 32533126..66cfe7cd 100644 --- a/tests/NRedisStack.Tests/TransactionsTests.cs +++ b/tests/NRedisStack.Tests/TransactionsTests.cs @@ -34,7 +34,7 @@ public async Task TestJsonTransaction() Assert.Equal("{\"Name\":\"Shachar\",\"Age\":23}", getResponse.Result.ToString()); } - [Fact] + [SkipIfRedisVersionGte("7.2.0")] public async Task TestModulsTransaction() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -84,5 +84,52 @@ public async Task TestModulsTransaction() Assert.NotNull(db.TS().Info("ts-key")); Assert.NotNull(db.TOPK().Info("topk-key")); } + + [Fact] + public async Task TestModulsTransactionWithoutGraph() + { + IDatabase db = redisFixture.Redis.GetDatabase(); + db.Execute("FLUSHALL"); + var tran = new Transaction(db); + + tran.Bf.ReserveAsync("bf-key", 0.001, 100); + tran.Bf.AddAsync("bf-key", "1"); + tran.Cms.InitByDimAsync("cms-key", 100, 5); + tran.Cf.ReserveAsync("cf-key", 100); + tran.Json.SetAsync("json-key", "$", "{}"); + tran.Ft.CreateAsync("ft-key", new FTCreateParams(), new Schema().AddTextField("txt")); + tran.Tdigest.CreateAsync("tdigest-key", 100); + tran.Ts.CreateAsync("ts-key", 100); + tran.TopK.ReserveAsync("topk-key", 100, 100, 100); + + Assert.False(db.KeyExists("bf-key")); + Assert.False(db.KeyExists("cms-key")); + Assert.False(db.KeyExists("cf-key")); + Assert.False(db.KeyExists("json-key")); + Assert.Equal(0, db.FT()._List().Length); + Assert.False(db.KeyExists("tdigest-key")); + Assert.False(db.KeyExists("ts-key")); + Assert.False(db.KeyExists("topk-key")); + + tran.Execute(); + + Assert.True(db.KeyExists("bf-key")); + Assert.True(db.KeyExists("cms-key")); + Assert.True(db.KeyExists("cf-key")); + Assert.True(db.KeyExists("json-key")); + Assert.True(db.FT()._List().Length == 1); + Assert.True(db.KeyExists("tdigest-key")); + Assert.True(db.KeyExists("ts-key")); + Assert.True(db.KeyExists("topk-key")); + + Assert.True(db.BF().Exists("bf-key", "1")); + Assert.True(db.CMS().Info("cms-key").Width == 100); + Assert.True(db.CF().Info("cf-key").Size > 0); + Assert.False(db.JSON().Get("json-key").IsNull); + Assert.NotNull(db.FT().Info("ft-key")); + Assert.NotNull(db.TDIGEST().Info("tdigest-key")); + Assert.NotNull(db.TS().Info("ts-key")); + Assert.NotNull(db.TOPK().Info("topk-key")); + } } } From 61dd8da3f0aa9a417bf4b4c1b6c1856a7d0e27af Mon Sep 17 00:00:00 2001 From: shacharPash Date: Wed, 9 Aug 2023 14:56:48 +0300 Subject: [PATCH 16/22] change to SkipIfRedisVersionGte("7.2.0-RC3") --- tests/NRedisStack.Tests/Graph/GraphTests.cs | 128 +++++++++---------- tests/NRedisStack.Tests/PipelineTests.cs | 2 +- tests/NRedisStack.Tests/TransactionsTests.cs | 2 +- 3 files changed, 66 insertions(+), 66 deletions(-) diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index a43f8a09..bc680620 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -20,7 +20,7 @@ public void Dispose() #region SyncTests - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -28,7 +28,7 @@ public void TestReserveBasic() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -51,7 +51,7 @@ public void TestCreateNode() graph.Delete("social"); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -72,7 +72,7 @@ public void TestCreateLabeledNode() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -99,7 +99,7 @@ public void TestConnectNodes() Assert.Equal(0, resultSet.Count); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -146,7 +146,7 @@ public void TestDeleteNodes() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -176,7 +176,7 @@ public void TestDeleteRelationship() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -203,7 +203,7 @@ public void TestIndex() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -234,7 +234,7 @@ public void TestHeader() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -359,7 +359,7 @@ public void TestRecord() } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -439,7 +439,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -458,7 +458,7 @@ public void TestEscapedQuery() Assert.NotNull(graph.Query("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -558,7 +558,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -610,7 +610,7 @@ public void TestPath() } } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -664,7 +664,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -682,7 +682,7 @@ public void Test64BitNumber() } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -713,7 +713,7 @@ public void TestCachedExecution() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -743,7 +743,7 @@ public void TestMapDataType() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -757,7 +757,7 @@ public void TestGeoPointLatLon() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -786,7 +786,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) Assert.Equal((object)(point), property); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -798,7 +798,7 @@ public void TestPoint() Assert.Throws(() => new Point(new List { 1, 2, 3 })); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -812,7 +812,7 @@ public void timeoutArgument() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -845,7 +845,7 @@ public void TestCachedExecutionReadOnly() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -860,7 +860,7 @@ public void TestSimpleReadOnly() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -878,7 +878,7 @@ public void TestProfile() } } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -896,7 +896,7 @@ public void TestExplain() } } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -911,7 +911,7 @@ public void TestSlowlog() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -924,7 +924,7 @@ public void TestList() Assert.Equal(new List() { "social" }, graph.List()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -944,7 +944,7 @@ public void TestConfig() graph.ConfigSet(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -956,7 +956,7 @@ public void TestModulePrefixs() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -977,7 +977,7 @@ public void TestCallProcedureDbLabels() Assert.Single(labels1); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1003,7 +1003,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1011,7 +1011,7 @@ public async Task TestReserveBasicAsync() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1034,7 +1034,7 @@ public async Task TestCreateNodeAsync() await graph.DeleteAsync("social"); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1055,7 +1055,7 @@ public async Task TestCreateLabeledNodeAsync() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1083,7 +1083,7 @@ public async Task TestConnectNodesAsync() // Assert.False(resultSet.GetEnumerator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1130,7 +1130,7 @@ public async Task TestDeleteNodesAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1160,7 +1160,7 @@ public async Task TestDeleteRelationshipAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1187,7 +1187,7 @@ public async Task TestIndexAsync() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1218,7 +1218,7 @@ public async Task TestHeaderAsync() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1345,7 +1345,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1425,7 +1425,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1444,7 +1444,7 @@ public async Task TestEscapedQueryAsync() Assert.NotNull(await graph.QueryAsync("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1544,7 +1544,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1596,7 +1596,7 @@ public async Task TestPathAsync() } } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1650,7 +1650,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1668,7 +1668,7 @@ public async Task Test64bitnumberAsync() } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1699,7 +1699,7 @@ public async Task TestCachedExecutionAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1729,7 +1729,7 @@ public async Task TestMapDataTypeAsync() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1743,7 +1743,7 @@ public async Task TestGeoPointLatLonAsync() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1771,7 +1771,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) Assert.Equal((object)(new Point(30.27822306, -97.75134723)), property); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1785,7 +1785,7 @@ public async Task timeoutArgumentAsync() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1818,7 +1818,7 @@ public async Task TestCachedExecutionReadOnlyAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1833,7 +1833,7 @@ public async Task TestSimpleReadOnlyAsync() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1851,7 +1851,7 @@ public async Task TestProfileAsync() } } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1869,7 +1869,7 @@ public async Task TestExplainAsync() } } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1884,7 +1884,7 @@ public async Task TestSlowlogAsync() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1897,7 +1897,7 @@ public async Task TestListAsync() Assert.Equal(new List() { "social" }, await graph.ListAsync()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1917,7 +1917,7 @@ public async Task TestConfigAsync() await graph.ConfigSetAsync(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1929,7 +1929,7 @@ public async Task TestModulePrefixsAsync() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1950,7 +1950,7 @@ public async Task TestCallProcedureDbLabelsAsync() Assert.Single(labels1); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1972,7 +1972,7 @@ public async Task TestCallProcedureReadOnlyAsync() await Assert.ThrowsAsync(() => graph.CallProcedureAsync(graphName, "db.idx.fulltext.createNodeIndex", procedureArgs, ProcedureMode.Read)); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1986,7 +1986,7 @@ public void TestParseInfinity() Assert.Equal(double.PositiveInfinity, r.Values[0]); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2063,7 +2063,7 @@ public void TestEqualsAndToString() Assert.Equal(expectedPathString, pathString); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; diff --git a/tests/NRedisStack.Tests/PipelineTests.cs b/tests/NRedisStack.Tests/PipelineTests.cs index ee7de833..12f5ee86 100644 --- a/tests/NRedisStack.Tests/PipelineTests.cs +++ b/tests/NRedisStack.Tests/PipelineTests.cs @@ -18,7 +18,7 @@ public void Dispose() redisFixture.Redis.GetDatabase().KeyDelete(key); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestModulsPipeline() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TransactionsTests.cs b/tests/NRedisStack.Tests/TransactionsTests.cs index 66cfe7cd..aa343d0c 100644 --- a/tests/NRedisStack.Tests/TransactionsTests.cs +++ b/tests/NRedisStack.Tests/TransactionsTests.cs @@ -34,7 +34,7 @@ public async Task TestJsonTransaction() Assert.Equal("{\"Name\":\"Shachar\",\"Age\":23}", getResponse.Result.ToString()); } - [SkipIfRedisVersionGte("7.2.0")] + [SkipIfRedisVersionGte("7.2.0-RC3")] public async Task TestModulsTransaction() { IDatabase db = redisFixture.Redis.GetDatabase(); From 50310ae49dc54732025d76268cdbd57f398fd0db Mon Sep 17 00:00:00 2001 From: shacharPash Date: Wed, 9 Aug 2023 15:07:12 +0300 Subject: [PATCH 17/22] try diif version --- tests/NRedisStack.Tests/Graph/GraphTests.cs | 128 +++++++++---------- tests/NRedisStack.Tests/PipelineTests.cs | 2 +- tests/NRedisStack.Tests/TransactionsTests.cs | 2 +- 3 files changed, 66 insertions(+), 66 deletions(-) diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index bc680620..2a14a42f 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -20,7 +20,7 @@ public void Dispose() #region SyncTests - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -28,7 +28,7 @@ public void TestReserveBasic() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -51,7 +51,7 @@ public void TestCreateNode() graph.Delete("social"); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -72,7 +72,7 @@ public void TestCreateLabeledNode() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -99,7 +99,7 @@ public void TestConnectNodes() Assert.Equal(0, resultSet.Count); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -146,7 +146,7 @@ public void TestDeleteNodes() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -176,7 +176,7 @@ public void TestDeleteRelationship() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -203,7 +203,7 @@ public void TestIndex() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -234,7 +234,7 @@ public void TestHeader() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -359,7 +359,7 @@ public void TestRecord() } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -439,7 +439,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -458,7 +458,7 @@ public void TestEscapedQuery() Assert.NotNull(graph.Query("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -558,7 +558,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -610,7 +610,7 @@ public void TestPath() } } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -664,7 +664,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -682,7 +682,7 @@ public void Test64BitNumber() } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -713,7 +713,7 @@ public void TestCachedExecution() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -743,7 +743,7 @@ public void TestMapDataType() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -757,7 +757,7 @@ public void TestGeoPointLatLon() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -786,7 +786,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) Assert.Equal((object)(point), property); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -798,7 +798,7 @@ public void TestPoint() Assert.Throws(() => new Point(new List { 1, 2, 3 })); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -812,7 +812,7 @@ public void timeoutArgument() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -845,7 +845,7 @@ public void TestCachedExecutionReadOnly() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -860,7 +860,7 @@ public void TestSimpleReadOnly() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -878,7 +878,7 @@ public void TestProfile() } } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -896,7 +896,7 @@ public void TestExplain() } } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -911,7 +911,7 @@ public void TestSlowlog() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -924,7 +924,7 @@ public void TestList() Assert.Equal(new List() { "social" }, graph.List()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -944,7 +944,7 @@ public void TestConfig() graph.ConfigSet(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -956,7 +956,7 @@ public void TestModulePrefixs() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -977,7 +977,7 @@ public void TestCallProcedureDbLabels() Assert.Single(labels1); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1003,7 +1003,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1011,7 +1011,7 @@ public async Task TestReserveBasicAsync() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1034,7 +1034,7 @@ public async Task TestCreateNodeAsync() await graph.DeleteAsync("social"); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1055,7 +1055,7 @@ public async Task TestCreateLabeledNodeAsync() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1083,7 +1083,7 @@ public async Task TestConnectNodesAsync() // Assert.False(resultSet.GetEnumerator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1130,7 +1130,7 @@ public async Task TestDeleteNodesAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1160,7 +1160,7 @@ public async Task TestDeleteRelationshipAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1187,7 +1187,7 @@ public async Task TestIndexAsync() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1218,7 +1218,7 @@ public async Task TestHeaderAsync() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1345,7 +1345,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1425,7 +1425,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1444,7 +1444,7 @@ public async Task TestEscapedQueryAsync() Assert.NotNull(await graph.QueryAsync("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1544,7 +1544,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1596,7 +1596,7 @@ public async Task TestPathAsync() } } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1650,7 +1650,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1668,7 +1668,7 @@ public async Task Test64bitnumberAsync() } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1699,7 +1699,7 @@ public async Task TestCachedExecutionAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1729,7 +1729,7 @@ public async Task TestMapDataTypeAsync() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1743,7 +1743,7 @@ public async Task TestGeoPointLatLonAsync() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1771,7 +1771,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) Assert.Equal((object)(new Point(30.27822306, -97.75134723)), property); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1785,7 +1785,7 @@ public async Task timeoutArgumentAsync() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1818,7 +1818,7 @@ public async Task TestCachedExecutionReadOnlyAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1833,7 +1833,7 @@ public async Task TestSimpleReadOnlyAsync() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1851,7 +1851,7 @@ public async Task TestProfileAsync() } } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1869,7 +1869,7 @@ public async Task TestExplainAsync() } } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1884,7 +1884,7 @@ public async Task TestSlowlogAsync() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1897,7 +1897,7 @@ public async Task TestListAsync() Assert.Equal(new List() { "social" }, await graph.ListAsync()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1917,7 +1917,7 @@ public async Task TestConfigAsync() await graph.ConfigSetAsync(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1929,7 +1929,7 @@ public async Task TestModulePrefixsAsync() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1950,7 +1950,7 @@ public async Task TestCallProcedureDbLabelsAsync() Assert.Single(labels1); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1972,7 +1972,7 @@ public async Task TestCallProcedureReadOnlyAsync() await Assert.ThrowsAsync(() => graph.CallProcedureAsync(graphName, "db.idx.fulltext.createNodeIndex", procedureArgs, ProcedureMode.Read)); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1986,7 +1986,7 @@ public void TestParseInfinity() Assert.Equal(double.PositiveInfinity, r.Values[0]); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2063,7 +2063,7 @@ public void TestEqualsAndToString() Assert.Equal(expectedPathString, pathString); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; diff --git a/tests/NRedisStack.Tests/PipelineTests.cs b/tests/NRedisStack.Tests/PipelineTests.cs index 12f5ee86..a2bc3fa3 100644 --- a/tests/NRedisStack.Tests/PipelineTests.cs +++ b/tests/NRedisStack.Tests/PipelineTests.cs @@ -18,7 +18,7 @@ public void Dispose() redisFixture.Redis.GetDatabase().KeyDelete(key); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestModulsPipeline() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TransactionsTests.cs b/tests/NRedisStack.Tests/TransactionsTests.cs index aa343d0c..286cc612 100644 --- a/tests/NRedisStack.Tests/TransactionsTests.cs +++ b/tests/NRedisStack.Tests/TransactionsTests.cs @@ -34,7 +34,7 @@ public async Task TestJsonTransaction() Assert.Equal("{\"Name\":\"Shachar\",\"Age\":23}", getResponse.Result.ToString()); } - [SkipIfRedisVersionGte("7.2.0-RC3")] + [SkipIfRedisVersionGte("7.1.999")] public async Task TestModulsTransaction() { IDatabase db = redisFixture.Redis.GetDatabase(); From 4be090d4caf456552135c366bccf21277d6172ce Mon Sep 17 00:00:00 2001 From: shacharPash Date: Thu, 10 Aug 2023 10:40:38 +0300 Subject: [PATCH 18/22] try very small version to check if skip --- tests/NRedisStack.Tests/Graph/GraphTests.cs | 128 ++++++++++---------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index 2a14a42f..ed63203b 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -20,7 +20,7 @@ public void Dispose() #region SyncTests - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -28,7 +28,7 @@ public void TestReserveBasic() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -51,7 +51,7 @@ public void TestCreateNode() graph.Delete("social"); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -72,7 +72,7 @@ public void TestCreateLabeledNode() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -99,7 +99,7 @@ public void TestConnectNodes() Assert.Equal(0, resultSet.Count); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -146,7 +146,7 @@ public void TestDeleteNodes() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -176,7 +176,7 @@ public void TestDeleteRelationship() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -203,7 +203,7 @@ public void TestIndex() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -234,7 +234,7 @@ public void TestHeader() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -359,7 +359,7 @@ public void TestRecord() } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -439,7 +439,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -458,7 +458,7 @@ public void TestEscapedQuery() Assert.NotNull(graph.Query("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -558,7 +558,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -610,7 +610,7 @@ public void TestPath() } } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -664,7 +664,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -682,7 +682,7 @@ public void Test64BitNumber() } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -713,7 +713,7 @@ public void TestCachedExecution() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -743,7 +743,7 @@ public void TestMapDataType() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -757,7 +757,7 @@ public void TestGeoPointLatLon() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -786,7 +786,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) Assert.Equal((object)(point), property); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -798,7 +798,7 @@ public void TestPoint() Assert.Throws(() => new Point(new List { 1, 2, 3 })); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -812,7 +812,7 @@ public void timeoutArgument() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -845,7 +845,7 @@ public void TestCachedExecutionReadOnly() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -860,7 +860,7 @@ public void TestSimpleReadOnly() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -878,7 +878,7 @@ public void TestProfile() } } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -896,7 +896,7 @@ public void TestExplain() } } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -911,7 +911,7 @@ public void TestSlowlog() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -924,7 +924,7 @@ public void TestList() Assert.Equal(new List() { "social" }, graph.List()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -944,7 +944,7 @@ public void TestConfig() graph.ConfigSet(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -956,7 +956,7 @@ public void TestModulePrefixs() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -977,7 +977,7 @@ public void TestCallProcedureDbLabels() Assert.Single(labels1); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1003,7 +1003,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1011,7 +1011,7 @@ public async Task TestReserveBasicAsync() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1034,7 +1034,7 @@ public async Task TestCreateNodeAsync() await graph.DeleteAsync("social"); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1055,7 +1055,7 @@ public async Task TestCreateLabeledNodeAsync() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1083,7 +1083,7 @@ public async Task TestConnectNodesAsync() // Assert.False(resultSet.GetEnumerator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1130,7 +1130,7 @@ public async Task TestDeleteNodesAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1160,7 +1160,7 @@ public async Task TestDeleteRelationshipAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1187,7 +1187,7 @@ public async Task TestIndexAsync() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1218,7 +1218,7 @@ public async Task TestHeaderAsync() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1345,7 +1345,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1425,7 +1425,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1444,7 +1444,7 @@ public async Task TestEscapedQueryAsync() Assert.NotNull(await graph.QueryAsync("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1544,7 +1544,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1596,7 +1596,7 @@ public async Task TestPathAsync() } } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1650,7 +1650,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1668,7 +1668,7 @@ public async Task Test64bitnumberAsync() } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1699,7 +1699,7 @@ public async Task TestCachedExecutionAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1729,7 +1729,7 @@ public async Task TestMapDataTypeAsync() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1743,7 +1743,7 @@ public async Task TestGeoPointLatLonAsync() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1771,7 +1771,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) Assert.Equal((object)(new Point(30.27822306, -97.75134723)), property); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1785,7 +1785,7 @@ public async Task timeoutArgumentAsync() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1818,7 +1818,7 @@ public async Task TestCachedExecutionReadOnlyAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1833,7 +1833,7 @@ public async Task TestSimpleReadOnlyAsync() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1851,7 +1851,7 @@ public async Task TestProfileAsync() } } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1869,7 +1869,7 @@ public async Task TestExplainAsync() } } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1884,7 +1884,7 @@ public async Task TestSlowlogAsync() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1897,7 +1897,7 @@ public async Task TestListAsync() Assert.Equal(new List() { "social" }, await graph.ListAsync()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1917,7 +1917,7 @@ public async Task TestConfigAsync() await graph.ConfigSetAsync(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1929,7 +1929,7 @@ public async Task TestModulePrefixsAsync() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1950,7 +1950,7 @@ public async Task TestCallProcedureDbLabelsAsync() Assert.Single(labels1); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1972,7 +1972,7 @@ public async Task TestCallProcedureReadOnlyAsync() await Assert.ThrowsAsync(() => graph.CallProcedureAsync(graphName, "db.idx.fulltext.createNodeIndex", procedureArgs, ProcedureMode.Read)); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1986,7 +1986,7 @@ public void TestParseInfinity() Assert.Equal(double.PositiveInfinity, r.Values[0]); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2063,7 +2063,7 @@ public void TestEqualsAndToString() Assert.Equal(expectedPathString, pathString); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("2.0.0")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; From d0f95730294946079986faa9d78023eb2289448d Mon Sep 17 00:00:00 2001 From: shacharPash Date: Thu, 10 Aug 2023 10:54:17 +0300 Subject: [PATCH 19/22] change version to 7.1.242 --- tests/NRedisStack.Tests/Graph/GraphTests.cs | 128 +++++++++---------- tests/NRedisStack.Tests/PipelineTests.cs | 2 +- tests/NRedisStack.Tests/TransactionsTests.cs | 2 +- 3 files changed, 66 insertions(+), 66 deletions(-) diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index ed63203b..e1e9f29f 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -20,7 +20,7 @@ public void Dispose() #region SyncTests - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -28,7 +28,7 @@ public void TestReserveBasic() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -51,7 +51,7 @@ public void TestCreateNode() graph.Delete("social"); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -72,7 +72,7 @@ public void TestCreateLabeledNode() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -99,7 +99,7 @@ public void TestConnectNodes() Assert.Equal(0, resultSet.Count); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -146,7 +146,7 @@ public void TestDeleteNodes() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -176,7 +176,7 @@ public void TestDeleteRelationship() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -203,7 +203,7 @@ public void TestIndex() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -234,7 +234,7 @@ public void TestHeader() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -359,7 +359,7 @@ public void TestRecord() } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -439,7 +439,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -458,7 +458,7 @@ public void TestEscapedQuery() Assert.NotNull(graph.Query("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -558,7 +558,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -610,7 +610,7 @@ public void TestPath() } } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -664,7 +664,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -682,7 +682,7 @@ public void Test64BitNumber() } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -713,7 +713,7 @@ public void TestCachedExecution() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -743,7 +743,7 @@ public void TestMapDataType() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -757,7 +757,7 @@ public void TestGeoPointLatLon() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -786,7 +786,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) Assert.Equal((object)(point), property); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -798,7 +798,7 @@ public void TestPoint() Assert.Throws(() => new Point(new List { 1, 2, 3 })); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -812,7 +812,7 @@ public void timeoutArgument() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -845,7 +845,7 @@ public void TestCachedExecutionReadOnly() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -860,7 +860,7 @@ public void TestSimpleReadOnly() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -878,7 +878,7 @@ public void TestProfile() } } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -896,7 +896,7 @@ public void TestExplain() } } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -911,7 +911,7 @@ public void TestSlowlog() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -924,7 +924,7 @@ public void TestList() Assert.Equal(new List() { "social" }, graph.List()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -944,7 +944,7 @@ public void TestConfig() graph.ConfigSet(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -956,7 +956,7 @@ public void TestModulePrefixs() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -977,7 +977,7 @@ public void TestCallProcedureDbLabels() Assert.Single(labels1); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1003,7 +1003,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1011,7 +1011,7 @@ public async Task TestReserveBasicAsync() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1034,7 +1034,7 @@ public async Task TestCreateNodeAsync() await graph.DeleteAsync("social"); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1055,7 +1055,7 @@ public async Task TestCreateLabeledNodeAsync() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1083,7 +1083,7 @@ public async Task TestConnectNodesAsync() // Assert.False(resultSet.GetEnumerator().MoveNext()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1130,7 +1130,7 @@ public async Task TestDeleteNodesAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1160,7 +1160,7 @@ public async Task TestDeleteRelationshipAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1187,7 +1187,7 @@ public async Task TestIndexAsync() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1218,7 +1218,7 @@ public async Task TestHeaderAsync() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1345,7 +1345,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1425,7 +1425,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1444,7 +1444,7 @@ public async Task TestEscapedQueryAsync() Assert.NotNull(await graph.QueryAsync("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1544,7 +1544,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1596,7 +1596,7 @@ public async Task TestPathAsync() } } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1650,7 +1650,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1668,7 +1668,7 @@ public async Task Test64bitnumberAsync() } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1699,7 +1699,7 @@ public async Task TestCachedExecutionAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1729,7 +1729,7 @@ public async Task TestMapDataTypeAsync() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1743,7 +1743,7 @@ public async Task TestGeoPointLatLonAsync() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1771,7 +1771,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) Assert.Equal((object)(new Point(30.27822306, -97.75134723)), property); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1785,7 +1785,7 @@ public async Task timeoutArgumentAsync() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1818,7 +1818,7 @@ public async Task TestCachedExecutionReadOnlyAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1833,7 +1833,7 @@ public async Task TestSimpleReadOnlyAsync() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1851,7 +1851,7 @@ public async Task TestProfileAsync() } } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1869,7 +1869,7 @@ public async Task TestExplainAsync() } } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1884,7 +1884,7 @@ public async Task TestSlowlogAsync() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1897,7 +1897,7 @@ public async Task TestListAsync() Assert.Equal(new List() { "social" }, await graph.ListAsync()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1917,7 +1917,7 @@ public async Task TestConfigAsync() await graph.ConfigSetAsync(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1929,7 +1929,7 @@ public async Task TestModulePrefixsAsync() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1950,7 +1950,7 @@ public async Task TestCallProcedureDbLabelsAsync() Assert.Single(labels1); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1972,7 +1972,7 @@ public async Task TestCallProcedureReadOnlyAsync() await Assert.ThrowsAsync(() => graph.CallProcedureAsync(graphName, "db.idx.fulltext.createNodeIndex", procedureArgs, ProcedureMode.Read)); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1986,7 +1986,7 @@ public void TestParseInfinity() Assert.Equal(double.PositiveInfinity, r.Values[0]); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2063,7 +2063,7 @@ public void TestEqualsAndToString() Assert.Equal(expectedPathString, pathString); } - [SkipIfRedisVersionGte("2.0.0")] + [SkipIfRedisVersionGte("7.1.242")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; diff --git a/tests/NRedisStack.Tests/PipelineTests.cs b/tests/NRedisStack.Tests/PipelineTests.cs index a2bc3fa3..b490d896 100644 --- a/tests/NRedisStack.Tests/PipelineTests.cs +++ b/tests/NRedisStack.Tests/PipelineTests.cs @@ -18,7 +18,7 @@ public void Dispose() redisFixture.Redis.GetDatabase().KeyDelete(key); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestModulsPipeline() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TransactionsTests.cs b/tests/NRedisStack.Tests/TransactionsTests.cs index 286cc612..f1468399 100644 --- a/tests/NRedisStack.Tests/TransactionsTests.cs +++ b/tests/NRedisStack.Tests/TransactionsTests.cs @@ -34,7 +34,7 @@ public async Task TestJsonTransaction() Assert.Equal("{\"Name\":\"Shachar\",\"Age\":23}", getResponse.Result.ToString()); } - [SkipIfRedisVersionGte("7.1.999")] + [SkipIfRedisVersionGte("7.1.242")] public async Task TestModulsTransaction() { IDatabase db = redisFixture.Redis.GetDatabase(); From 5496d022462f2a319ffc77cde982e74179e77a02 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Thu, 10 Aug 2023 12:26:29 +0300 Subject: [PATCH 20/22] Delete trait --- .github/workflows/integration.yml | 14 +++---------- .../AbstractNRedisStackTest.cs | 2 -- tests/NRedisStack.Tests/Gears/GearsTests.cs | 21 +++++++------------ tests/NRedisStack.Tests/Json/JsonTests.cs | 12 ++++------- tests/NRedisStack.Tests/RedisFixture.cs | 2 -- ...nAttribute.cs => SkipIfRedisVersionGte.cs} | 0 ...e.cs => SkipIfServerVersionLtAttribute.cs} | 0 7 files changed, 14 insertions(+), 37 deletions(-) rename tests/NRedisStack.Tests/{SkipIfServerVersionGreaterThanAttribute.cs => SkipIfRedisVersionGte.cs} (100%) rename tests/NRedisStack.Tests/{SkipIfServerVersionLessThanAttribute.cs => SkipIfServerVersionLtAttribute.cs} (100%) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 299fe5ef..02e9f818 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -46,22 +46,14 @@ 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 - if [ "$REDIS_VERSION" != "edge" ]; then - dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge - else - dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - fi + dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Test run: | echo "${{secrets.REDIS_CA_PEM}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_ca.pem echo "${{secrets.REDIS_USER_CRT}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_user.crt echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_user_private.key ls -R - if [ "$REDIS_VERSION" != "edge" ]; then - dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge - else - dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - fi + dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Codecov uses: codecov/codecov-action@v3 with: @@ -105,4 +97,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 --filter Category!=edge + dotnet test -f net481 --no-build --verbosity normal diff --git a/tests/NRedisStack.Tests/AbstractNRedisStackTest.cs b/tests/NRedisStack.Tests/AbstractNRedisStackTest.cs index 9e0e4c50..b84d259a 100644 --- a/tests/NRedisStack.Tests/AbstractNRedisStackTest.cs +++ b/tests/NRedisStack.Tests/AbstractNRedisStackTest.cs @@ -7,8 +7,6 @@ namespace NRedisStack.Tests { public abstract class AbstractNRedisStackTest : IClassFixture, IAsyncLifetime { - public Version ServerVersion => redisFixture.ServerVersion; - protected internal RedisFixture redisFixture; protected internal AbstractNRedisStackTest(RedisFixture redisFixture) => this.redisFixture = redisFixture; diff --git a/tests/NRedisStack.Tests/Gears/GearsTests.cs b/tests/NRedisStack.Tests/Gears/GearsTests.cs index 79d7f7ae..80bdef8b 100644 --- a/tests/NRedisStack.Tests/Gears/GearsTests.cs +++ b/tests/NRedisStack.Tests/Gears/GearsTests.cs @@ -16,8 +16,7 @@ public void Dispose() } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public void TestTFunctionLoadDelete() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -27,8 +26,7 @@ public void TestTFunctionLoadDelete() } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public async Task TestTFunctionLoadDeleteAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -39,8 +37,7 @@ public async Task TestTFunctionLoadDeleteAsync() Assert.True(await db.TFunctionDeleteAsync("lib")); } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public void TestTFunctionList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -71,8 +68,7 @@ public void TestTFunctionList() Assert.True(db.TFunctionDelete("lib3")); } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public async Task TestTFunctionListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -101,8 +97,7 @@ public async Task TestTFunctionListAsync() Assert.True(await db.TFunctionDeleteAsync("lib3")); } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public void TestTFCall() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -116,8 +111,7 @@ public void TestTFCall() Assert.True(db.TFunctionDelete("lib")); } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public async Task TestTFCallAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -131,8 +125,7 @@ public async Task TestTFCallAsync() Assert.True(await db.TFunctionDeleteAsync("lib")); } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public void TestGearsCommandBuilder() { // TFunctionLoad: diff --git a/tests/NRedisStack.Tests/Json/JsonTests.cs b/tests/NRedisStack.Tests/Json/JsonTests.cs index f437af67..cf0d6cfb 100644 --- a/tests/NRedisStack.Tests/Json/JsonTests.cs +++ b/tests/NRedisStack.Tests/Json/JsonTests.cs @@ -703,8 +703,7 @@ public async Task GetAsync() Assert.Equal(35, people[1]!.Age); } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public void MSet() { IJsonCommands commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -728,8 +727,7 @@ public void MSet() Assert.Throws(() => commands.MSet(new KeyPathValue[0])); } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public async Task MSetAsync() { IJsonCommandsAsync commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -752,8 +750,7 @@ await commands.MSetAsync(values) await Assert.ThrowsAsync(async () => await commands.MSetAsync(new KeyPathValue[0])); } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public void Merge() { // Create a connection to Redis @@ -772,8 +769,7 @@ public void Merge() Assert.Equal("{\"person\":{\"name\":\"John Doe\",\"phone\":\"123-456-7890\",\"address\":{\"home\":\"123 Main Street\",\"work\":\"Redis office\"}}}", commands.Get("test_merge").ToString()); } - [Fact] - [Trait("Category", "edge")] + [SkipIfRedisVersionLt("7.1.242")] public async Task MergeAsync() { // Create a connection to Redis diff --git a/tests/NRedisStack.Tests/RedisFixture.cs b/tests/NRedisStack.Tests/RedisFixture.cs index 28514c5c..8ae470f2 100644 --- a/tests/NRedisStack.Tests/RedisFixture.cs +++ b/tests/NRedisStack.Tests/RedisFixture.cs @@ -16,7 +16,5 @@ public void Dispose() } public ConnectionMultiplexer Redis { get; private set; } - - public Version ServerVersion => Redis.GetServer(redis).Version; } } \ No newline at end of file diff --git a/tests/NRedisStack.Tests/SkipIfServerVersionGreaterThanAttribute.cs b/tests/NRedisStack.Tests/SkipIfRedisVersionGte.cs similarity index 100% rename from tests/NRedisStack.Tests/SkipIfServerVersionGreaterThanAttribute.cs rename to tests/NRedisStack.Tests/SkipIfRedisVersionGte.cs diff --git a/tests/NRedisStack.Tests/SkipIfServerVersionLessThanAttribute.cs b/tests/NRedisStack.Tests/SkipIfServerVersionLtAttribute.cs similarity index 100% rename from tests/NRedisStack.Tests/SkipIfServerVersionLessThanAttribute.cs rename to tests/NRedisStack.Tests/SkipIfServerVersionLtAttribute.cs From 6b38f84cb93f53a8b68610be93427cf5d53ed5c8 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 13 Aug 2023 15:09:03 +0300 Subject: [PATCH 21/22] one SkipIfRedisVersionAttribute --- tests/NRedisStack.Tests/Gears/GearsTests.cs | 14 +- tests/NRedisStack.Tests/Graph/GraphTests.cs | 128 +++++++++--------- tests/NRedisStack.Tests/Json/JsonTests.cs | 8 +- .../SkipIfRedisVersionAttribute.cs | 55 ++++++++ .../SkipIfRedisVersionGte.cs | 32 ----- .../SkipIfServerVersionLtAttribute.cs | 32 ----- 6 files changed, 130 insertions(+), 139 deletions(-) create mode 100644 tests/NRedisStack.Tests/SkipIfRedisVersionAttribute.cs delete mode 100644 tests/NRedisStack.Tests/SkipIfRedisVersionGte.cs delete mode 100644 tests/NRedisStack.Tests/SkipIfServerVersionLtAttribute.cs diff --git a/tests/NRedisStack.Tests/Gears/GearsTests.cs b/tests/NRedisStack.Tests/Gears/GearsTests.cs index 80bdef8b..465a65ff 100644 --- a/tests/NRedisStack.Tests/Gears/GearsTests.cs +++ b/tests/NRedisStack.Tests/Gears/GearsTests.cs @@ -16,7 +16,7 @@ public void Dispose() } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion(Comparison.LessThan, "7.1.242")] public void TestTFunctionLoadDelete() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -26,7 +26,7 @@ public void TestTFunctionLoadDelete() } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion(Comparison.LessThan, "7.1.242")] public async Task TestTFunctionLoadDeleteAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -37,7 +37,7 @@ public async Task TestTFunctionLoadDeleteAsync() Assert.True(await db.TFunctionDeleteAsync("lib")); } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion(Comparison.LessThan, "7.1.242")] public void TestTFunctionList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -68,7 +68,7 @@ public void TestTFunctionList() Assert.True(db.TFunctionDelete("lib3")); } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion(Comparison.LessThan, "7.1.242")] public async Task TestTFunctionListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -97,7 +97,7 @@ public async Task TestTFunctionListAsync() Assert.True(await db.TFunctionDeleteAsync("lib3")); } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion(Comparison.LessThan, "7.1.242")] public void TestTFCall() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -111,7 +111,7 @@ public void TestTFCall() Assert.True(db.TFunctionDelete("lib")); } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion(Comparison.LessThan, "7.1.242")] public async Task TestTFCallAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -125,7 +125,7 @@ public async Task TestTFCallAsync() Assert.True(await db.TFunctionDeleteAsync("lib")); } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion(Comparison.LessThan, "7.1.242")] public void TestGearsCommandBuilder() { // TFunctionLoad: diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index e1e9f29f..b7a49c03 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -20,7 +20,7 @@ public void Dispose() #region SyncTests - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestReserveBasic() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -28,7 +28,7 @@ public void TestReserveBasic() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestCreateNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -51,7 +51,7 @@ public void TestCreateNode() graph.Delete("social"); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestCreateLabeledNode() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -72,7 +72,7 @@ public void TestCreateLabeledNode() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestConnectNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -99,7 +99,7 @@ public void TestConnectNodes() Assert.Equal(0, resultSet.Count); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestDeleteNodes() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -146,7 +146,7 @@ public void TestDeleteNodes() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestDeleteRelationship() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -176,7 +176,7 @@ public void TestDeleteRelationship() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestIndex() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -203,7 +203,7 @@ public void TestIndex() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestHeader() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -234,7 +234,7 @@ public void TestHeader() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestRecord() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -359,7 +359,7 @@ public void TestRecord() } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestAdditionToProcedures() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -439,7 +439,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestEscapedQuery() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -458,7 +458,7 @@ public void TestEscapedQuery() Assert.NotNull(graph.Query("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestArraySupport() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -558,7 +558,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestPath() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -610,7 +610,7 @@ public void TestPath() } } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestNullGraphEntities() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -664,7 +664,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void Test64BitNumber() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -682,7 +682,7 @@ public void Test64BitNumber() } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestCachedExecution() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -713,7 +713,7 @@ public void TestCachedExecution() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestMapDataType() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -743,7 +743,7 @@ public void TestMapDataType() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestGeoPointLatLon() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -757,7 +757,7 @@ public void TestGeoPointLatLon() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestGeoPointLonLat() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -786,7 +786,7 @@ private void AssertTestGeoPoint(IGraphCommands graph) Assert.Equal((object)(point), property); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestPoint() { var point = new Point(30.27822306, -97.75134723); @@ -798,7 +798,7 @@ public void TestPoint() Assert.Throws(() => new Point(new List { 1, 2, 3 })); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void timeoutArgument() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -812,7 +812,7 @@ public void timeoutArgument() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestCachedExecutionReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -845,7 +845,7 @@ public void TestCachedExecutionReadOnly() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestSimpleReadOnly() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -860,7 +860,7 @@ public void TestSimpleReadOnly() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestProfile() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -878,7 +878,7 @@ public void TestProfile() } } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestExplain() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -896,7 +896,7 @@ public void TestExplain() } } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestSlowlog() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -911,7 +911,7 @@ public void TestSlowlog() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestList() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -924,7 +924,7 @@ public void TestList() Assert.Equal(new List() { "social" }, graph.List()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestConfig() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -944,7 +944,7 @@ public void TestConfig() graph.ConfigSet(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestModulePrefixs() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -956,7 +956,7 @@ public void TestModulePrefixs() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestCallProcedureDbLabels() { var db = redisFixture.Redis.GetDatabase(); @@ -977,7 +977,7 @@ public void TestCallProcedureDbLabels() Assert.Single(labels1); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestCallProcedureReadOnly() { var db = redisFixture.Redis.GetDatabase(); @@ -1003,7 +1003,7 @@ public void TestCallProcedureReadOnly() #region AsyncTests - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestReserveBasicAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1011,7 +1011,7 @@ public async Task TestReserveBasicAsync() var graph = db.GRAPH(); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestCreateNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1034,7 +1034,7 @@ public async Task TestCreateNodeAsync() await graph.DeleteAsync("social"); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestCreateLabeledNodeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1055,7 +1055,7 @@ public async Task TestCreateLabeledNodeAsync() // Assert.False(resultSet..iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestConnectNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1083,7 +1083,7 @@ public async Task TestConnectNodesAsync() // Assert.False(resultSet.GetEnumerator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestDeleteNodesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1130,7 +1130,7 @@ public async Task TestDeleteNodesAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestDeleteRelationshipAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1160,7 +1160,7 @@ public async Task TestDeleteRelationshipAsync() // Assert.False(deleteResult.iterator().MoveNext()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestIndexAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1187,7 +1187,7 @@ public async Task TestIndexAsync() Assert.Equal(1, deleteExistingIndexResult.Statistics.IndicesDeleted); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestHeaderAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1218,7 +1218,7 @@ public async Task TestHeaderAsync() Assert.Equal("a.age", schemaNames[2]); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestRecordAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1345,7 +1345,7 @@ await graph.QueryAsync("social", "MATCH (a:person), (b:person) WHERE (a.name = ' } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestAdditionToProceduresAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1425,7 +1425,7 @@ record = iterator.Current; Assert.Equal(expectedEdge.ToString(), record.Values[1].ToString()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestEscapedQueryAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1444,7 +1444,7 @@ public async Task TestEscapedQueryAsync() Assert.NotNull(await graph.QueryAsync("social", "MATCH (n) where n.s1='S\"' RETURN n")); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestArraySupportAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1544,7 +1544,7 @@ record = iterator.Current; } } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestPathAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1596,7 +1596,7 @@ public async Task TestPathAsync() } } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestNullGraphEntitiesAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1650,7 +1650,7 @@ record = resultSet.Skip(1).First(); Assert.Null(record.Values[0]); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task Test64bitnumberAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1668,7 +1668,7 @@ public async Task Test64bitnumberAsync() } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestCachedExecutionAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1699,7 +1699,7 @@ public async Task TestCachedExecutionAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestMapDataTypeAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1729,7 +1729,7 @@ public async Task TestMapDataTypeAsync() Assert.Equal((object)expected, actual); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestGeoPointLatLonAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1743,7 +1743,7 @@ public async Task TestGeoPointLatLonAsync() AssertTestGeoPoint(graph); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestGeoPointLonLatAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1771,7 +1771,7 @@ private async Task AssertTestGeoPointAsync(GraphCommands graph) Assert.Equal((object)(new Point(30.27822306, -97.75134723)), property); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task timeoutArgumentAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1785,7 +1785,7 @@ public async Task timeoutArgumentAsync() Assert.Equal(100l, (long)r.Values[0]); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestCachedExecutionReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1818,7 +1818,7 @@ public async Task TestCachedExecutionReadOnlyAsync() Assert.True(resultSet.Statistics.CachedExecution); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestSimpleReadOnlyAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1833,7 +1833,7 @@ public async Task TestSimpleReadOnlyAsync() Assert.Equal("30", r.Values[0].ToString()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestProfileAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1851,7 +1851,7 @@ public async Task TestProfileAsync() } } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestExplainAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1869,7 +1869,7 @@ public async Task TestExplainAsync() } } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestSlowlogAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1884,7 +1884,7 @@ public async Task TestSlowlogAsync() slowlogs.ForEach(sl => sl.ForEach(s => Assert.NotNull(s))); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestListAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1897,7 +1897,7 @@ public async Task TestListAsync() Assert.Equal(new List() { "social" }, await graph.ListAsync()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestConfigAsync() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1917,7 +1917,7 @@ public async Task TestConfigAsync() await graph.ConfigSetAsync(name, existingValue != null ? existingValue.ToString() : -1); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestModulePrefixsAsync() { IDatabase db1 = redisFixture.Redis.GetDatabase(); @@ -1929,7 +1929,7 @@ public async Task TestModulePrefixsAsync() Assert.NotEqual(graph1.GetHashCode(), graph2.GetHashCode()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestCallProcedureDbLabelsAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1950,7 +1950,7 @@ public async Task TestCallProcedureDbLabelsAsync() Assert.Single(labels1); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestCallProcedureReadOnlyAsync() { var db = redisFixture.Redis.GetDatabase(); @@ -1972,7 +1972,7 @@ public async Task TestCallProcedureReadOnlyAsync() await Assert.ThrowsAsync(() => graph.CallProcedureAsync(graphName, "db.idx.fulltext.createNodeIndex", procedureArgs, ProcedureMode.Read)); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestParseInfinity() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -1986,7 +1986,7 @@ public void TestParseInfinity() Assert.Equal(double.PositiveInfinity, r.Values[0]); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestEqualsAndToString() { IDatabase db = redisFixture.Redis.GetDatabase(); @@ -2063,7 +2063,7 @@ public void TestEqualsAndToString() Assert.Equal(expectedPathString, pathString); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public void TestPrepareQuery() { const string return1Query = "RETURN 1"; diff --git a/tests/NRedisStack.Tests/Json/JsonTests.cs b/tests/NRedisStack.Tests/Json/JsonTests.cs index cf0d6cfb..1ad5ef8a 100644 --- a/tests/NRedisStack.Tests/Json/JsonTests.cs +++ b/tests/NRedisStack.Tests/Json/JsonTests.cs @@ -703,7 +703,7 @@ public async Task GetAsync() Assert.Equal(35, people[1]!.Age); } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion("7.1.242")] public void MSet() { IJsonCommands commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -727,7 +727,7 @@ public void MSet() Assert.Throws(() => commands.MSet(new KeyPathValue[0])); } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion("7.1.242")] public async Task MSetAsync() { IJsonCommandsAsync commands = new JsonCommands(redisFixture.Redis.GetDatabase()); @@ -750,7 +750,7 @@ await commands.MSetAsync(values) await Assert.ThrowsAsync(async () => await commands.MSetAsync(new KeyPathValue[0])); } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion("7.1.242")] public void Merge() { // Create a connection to Redis @@ -769,7 +769,7 @@ public void Merge() Assert.Equal("{\"person\":{\"name\":\"John Doe\",\"phone\":\"123-456-7890\",\"address\":{\"home\":\"123 Main Street\",\"work\":\"Redis office\"}}}", commands.Get("test_merge").ToString()); } - [SkipIfRedisVersionLt("7.1.242")] + [SkipIfRedisVersion("7.1.242")] public async Task MergeAsync() { // Create a connection to Redis diff --git a/tests/NRedisStack.Tests/SkipIfRedisVersionAttribute.cs b/tests/NRedisStack.Tests/SkipIfRedisVersionAttribute.cs new file mode 100644 index 00000000..6d19bc2c --- /dev/null +++ b/tests/NRedisStack.Tests/SkipIfRedisVersionAttribute.cs @@ -0,0 +1,55 @@ +using Xunit; +using StackExchange.Redis; + +public enum Comparison +{ + LessThan, + GreaterThanOrEqual, +} + +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +public class SkipIfRedisVersionAttribute : FactAttribute +{ + private readonly string _targetVersion; + private readonly Comparison _comparison; + private readonly string DefaultRedisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; + + public SkipIfRedisVersionAttribute(string targetVersion) // defaults to LessThan + { + _comparison = Comparison.LessThan; + _targetVersion = targetVersion; + } + + public SkipIfRedisVersionAttribute(Comparison comparison, string targetVersion) + { + _comparison = comparison; + _targetVersion = targetVersion; + } + + public override string Skip + { + get + { + using (var connection = ConnectionMultiplexer.Connect(DefaultRedisConnectionString)) + { + var serverVersion = connection.GetServer(connection.GetEndPoints()[0]).Version; + var targetVersion = new Version(_targetVersion); + int comparisonResult = serverVersion.CompareTo(targetVersion); + + switch (_comparison) + { + case Comparison.LessThan: + if (comparisonResult < 0) + return $"Test skipped because Redis server version ({serverVersion}) is less than {_targetVersion}."; + break; + case Comparison.GreaterThanOrEqual: + if (comparisonResult >= 0) + return $"Test skipped because Redis server version ({serverVersion}) is greater than or equal to {_targetVersion}."; + break; + } + + return null; + } + } + } +} \ No newline at end of file diff --git a/tests/NRedisStack.Tests/SkipIfRedisVersionGte.cs b/tests/NRedisStack.Tests/SkipIfRedisVersionGte.cs deleted file mode 100644 index 85d44ade..00000000 --- a/tests/NRedisStack.Tests/SkipIfRedisVersionGte.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Xunit; -using StackExchange.Redis; - -[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] -public class SkipIfRedisVersionGteAttribute : FactAttribute -{ - private readonly string _minVersion; - private readonly string DefaultRedisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; - - public SkipIfRedisVersionGteAttribute(string minVersion) - { - _minVersion = minVersion; - } - - public override string Skip - { - get - { - using (var connection = ConnectionMultiplexer.Connect(DefaultRedisConnectionString)) - { - var serverVersion = connection.GetServer(connection.GetEndPoints()[0]).Version; - - if (serverVersion >= new Version(_minVersion)) - { - return $"Test skipped because Redis server version ({serverVersion}) is >= {_minVersion}."; - } - - return null; - } - } - } -} \ No newline at end of file diff --git a/tests/NRedisStack.Tests/SkipIfServerVersionLtAttribute.cs b/tests/NRedisStack.Tests/SkipIfServerVersionLtAttribute.cs deleted file mode 100644 index a00a2f3b..00000000 --- a/tests/NRedisStack.Tests/SkipIfServerVersionLtAttribute.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Xunit; -using StackExchange.Redis; - -[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] -public class SkipIfRedisVersionLtAttribute : FactAttribute -{ - private readonly string _minVersion; - private readonly string DefaultRedisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; - - public SkipIfRedisVersionLtAttribute(string minVersion) - { - _minVersion = minVersion; - } - - public override string Skip - { - get - { - using (var connection = ConnectionMultiplexer.Connect(DefaultRedisConnectionString)) - { - var serverVersion = connection.GetServer(connection.GetEndPoints()[0]).Version; - - if (serverVersion < new Version(_minVersion)) - { - return $"Test skipped because Redis server version ({serverVersion}) is < {_minVersion}."; - } - - return null; - } - } - } -} \ No newline at end of file From b99dc71a62a0d7c30abb4782179ba2bfec9420e9 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 13 Aug 2023 15:47:22 +0300 Subject: [PATCH 22/22] fix error --- tests/NRedisStack.Tests/PipelineTests.cs | 2 +- tests/NRedisStack.Tests/TransactionsTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/NRedisStack.Tests/PipelineTests.cs b/tests/NRedisStack.Tests/PipelineTests.cs index b490d896..37ed8dcf 100644 --- a/tests/NRedisStack.Tests/PipelineTests.cs +++ b/tests/NRedisStack.Tests/PipelineTests.cs @@ -18,7 +18,7 @@ public void Dispose() redisFixture.Redis.GetDatabase().KeyDelete(key); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestModulsPipeline() { IDatabase db = redisFixture.Redis.GetDatabase(); diff --git a/tests/NRedisStack.Tests/TransactionsTests.cs b/tests/NRedisStack.Tests/TransactionsTests.cs index f1468399..f89a8191 100644 --- a/tests/NRedisStack.Tests/TransactionsTests.cs +++ b/tests/NRedisStack.Tests/TransactionsTests.cs @@ -34,7 +34,7 @@ public async Task TestJsonTransaction() Assert.Equal("{\"Name\":\"Shachar\",\"Age\":23}", getResponse.Result.ToString()); } - [SkipIfRedisVersionGte("7.1.242")] + [SkipIfRedisVersion(Comparison.GreaterThanOrEqual, "7.1.242")] public async Task TestModulsTransaction() { IDatabase db = redisFixture.Redis.GetDatabase();