From 5a3aaeff62d42dda01448b9aabd75885e80a9fac Mon Sep 17 00:00:00 2001 From: shacharPash Date: Thu, 9 Mar 2023 14:37:42 +0200 Subject: [PATCH 01/41] Target .NET Standard 2.0 --- src/NRedisStack/Graph/Header.cs | 12 ++++++++++-- src/NRedisStack/Json/JsonCommands.cs | 16 ++++++++-------- src/NRedisStack/Json/JsonCommandsAsync.cs | 11 ++++++----- src/NRedisStack/NRedisStack.csproj | 8 +++++--- src/NRedisStack/ResponseParser.cs | 2 +- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/NRedisStack/Graph/Header.cs b/src/NRedisStack/Graph/Header.cs index 3101986c..26f0bf5c 100644 --- a/src/NRedisStack/Graph/Header.cs +++ b/src/NRedisStack/Graph/Header.cs @@ -34,7 +34,7 @@ internal Header(RedisResult result) SchemaTypes = new List(); SchemaNames = new List(); - foreach(RedisResult[] tuple in (RedisResult[])result) + foreach (RedisResult[] tuple in (RedisResult[])result) { SchemaTypes.Add((ResultSetColumnTypes)(int)tuple[0]); SchemaNames.Add((string)tuple[1]); @@ -63,9 +63,17 @@ public override bool Equals(object? obj) public override int GetHashCode() { - return HashCode.Combine(SchemaTypes, SchemaNames); + unchecked + { + int hash = 17; + hash = hash * 23 + SchemaTypes.GetHashCode(); + hash = hash * 23 + SchemaNames.GetHashCode(); + return hash; + } } + + public override string ToString() => $"Header{{schemaTypes=[{string.Join(", ", SchemaTypes)}], schemaNames=[{string.Join(", ", SchemaNames)}]}}"; } diff --git a/src/NRedisStack/Json/JsonCommands.cs b/src/NRedisStack/Json/JsonCommands.cs index 6e309be2..94e3954f 100644 --- a/src/NRedisStack/Json/JsonCommands.cs +++ b/src/NRedisStack/Json/JsonCommands.cs @@ -1,6 +1,6 @@ using StackExchange.Redis; using System.Text.Json; -using System.Text.Json.Nodes; +// using System.Text.Json.Nodes; namespace NRedisStack; @@ -42,12 +42,12 @@ public bool Set(RedisKey key, RedisValue path, RedisValue json, When when = When /// public bool SetFromFile(RedisKey key, RedisValue path, string filePath, When when = When.Always) { - if(!File.Exists(filePath)) + if (!File.Exists(filePath)) { throw new FileNotFoundException($"File {filePath} not found."); } - string fileContent = File.ReadAllText(filePath); + string fileContent = File.ReadAllText(filePath); return Set(key, path, fileContent, when); } @@ -60,7 +60,7 @@ public int SetFromDirectory(RedisValue path, string filesPath, When when = When. foreach (var filePath in files) { key = filePath.Substring(0, filePath.IndexOf(".")); - if(SetFromFile(key, path, filePath, when)) + if (SetFromFile(key, path, filePath, when)) { inserted++; } @@ -111,12 +111,12 @@ public JsonType[] Type(RedisKey key, string? path = null) if (result.Type == ResultType.MultiBulk) { - return ((RedisResult[])result!).Select(x => Enum.Parse(x.ToString()!.ToUpper())).ToArray(); + return ((RedisResult[])result!).Select(x => (JsonType)Enum.Parse(typeof(JsonType), x.ToString()!.ToUpper())).ToArray(); } if (result.Type == ResultType.BulkString) { - return new[] { Enum.Parse(result.ToString()!.ToUpper()) }; + return new[] { (JsonType)Enum.Parse(typeof(JsonType), result.ToString()!.ToUpper()) }; } return Array.Empty(); @@ -207,8 +207,8 @@ public RedisResult Get(RedisKey key, string[] paths, RedisValue? indent = null, var res = _db.Execute(JsonCommandBuilder.Get(key, path)); if (res.Type == ResultType.BulkString) { - var arr = JsonSerializer.Deserialize(res.ToString()!); - if (arr?.Count > 0) + var arr = JsonSerializer.Deserialize(res.ToString()!); + if (arr?.Length > 0) { return JsonSerializer.Deserialize(JsonSerializer.Serialize(arr[0])); } diff --git a/src/NRedisStack/Json/JsonCommandsAsync.cs b/src/NRedisStack/Json/JsonCommandsAsync.cs index d20c993c..3dcfdb81 100644 --- a/src/NRedisStack/Json/JsonCommandsAsync.cs +++ b/src/NRedisStack/Json/JsonCommandsAsync.cs @@ -1,6 +1,6 @@ using StackExchange.Redis; using System.Text.Json; -using System.Text.Json.Nodes; +// using System.Text.Json.Nodes; namespace NRedisStack; @@ -82,8 +82,8 @@ public async Task GetAsync(RedisKey key, string[] paths, RedisValue var res = await _db.ExecuteAsync(JsonCommandBuilder.Get(key, path)); if (res.Type == ResultType.BulkString) { - var arr = JsonSerializer.Deserialize(res.ToString()!); - if (arr?.Count > 0) + var arr = JsonSerializer.Deserialize(res.ToString()!); + if (arr?.Length > 0) { return JsonSerializer.Deserialize(JsonSerializer.Serialize(arr[0])); } @@ -92,6 +92,7 @@ public async Task GetAsync(RedisKey key, string[] paths, RedisValue return default; } + /// public async Task> GetEnumerableAsync(RedisKey key, string path = "$") { @@ -209,12 +210,12 @@ public async Task TypeAsync(RedisKey key, string? path = null) if (result.Type == ResultType.MultiBulk) { - return ((RedisResult[])result!).Select(x => Enum.Parse(x.ToString()!.ToUpper())).ToArray(); + return ((RedisResult[])result!).Select(x => (JsonType)Enum.Parse(typeof(JsonType), x.ToString()!.ToUpper())).ToArray(); } if (result.Type == ResultType.BulkString) { - return new[] { Enum.Parse(result.ToString()!.ToUpper()) }; + return new[] { (JsonType)Enum.Parse(typeof(JsonType), result.ToString()!.ToUpper()) }; } return Array.Empty(); diff --git a/src/NRedisStack/NRedisStack.csproj b/src/NRedisStack/NRedisStack.csproj index ed1e5667..cd8fc00a 100644 --- a/src/NRedisStack/NRedisStack.csproj +++ b/src/NRedisStack/NRedisStack.csproj @@ -1,9 +1,10 @@ - net6.0;net7.0 - enable - enable + enable + netstandard2.0;net6.0;net7.0 + latest + enable Redis Open Source Redis OSS .Net Client for Redis Stack @@ -14,6 +15,7 @@ + diff --git a/src/NRedisStack/ResponseParser.cs b/src/NRedisStack/ResponseParser.cs index da2fc361..d96c20fd 100644 --- a/src/NRedisStack/ResponseParser.cs +++ b/src/NRedisStack/ResponseParser.cs @@ -591,7 +591,7 @@ public static IEnumerable> ToHashSets(this RedisResult result) if (res.All(x => x.Type != ResultType.MultiBulk)) { var keys = res.Select(x => x.ToString()!); - sets.Add(keys.ToHashSet()); + sets.Add(new HashSet(keys)); return sets; } From 353053a2abea81a1ab12160a3c716fd8cf3ff2b6 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Thu, 9 Mar 2023 15:21:35 +0200 Subject: [PATCH 02/41] add condition --- src/NRedisStack/NRedisStack.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NRedisStack/NRedisStack.csproj b/src/NRedisStack/NRedisStack.csproj index cd8fc00a..782b384b 100644 --- a/src/NRedisStack/NRedisStack.csproj +++ b/src/NRedisStack/NRedisStack.csproj @@ -15,7 +15,7 @@ - + From d1299c2e3656b600c2490098b13e7404a6377a23 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 12 Mar 2023 16:12:37 +0200 Subject: [PATCH 03/41] update to the latest version of System.Text.Json --- src/NRedisStack/Json/JsonCommands.cs | 6 +++--- src/NRedisStack/Json/JsonCommandsAsync.cs | 7 +++---- src/NRedisStack/NRedisStack.csproj | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/NRedisStack/Json/JsonCommands.cs b/src/NRedisStack/Json/JsonCommands.cs index 94e3954f..0add4087 100644 --- a/src/NRedisStack/Json/JsonCommands.cs +++ b/src/NRedisStack/Json/JsonCommands.cs @@ -1,6 +1,6 @@ using StackExchange.Redis; using System.Text.Json; -// using System.Text.Json.Nodes; +using System.Text.Json.Nodes; namespace NRedisStack; @@ -207,8 +207,8 @@ public RedisResult Get(RedisKey key, string[] paths, RedisValue? indent = null, var res = _db.Execute(JsonCommandBuilder.Get(key, path)); if (res.Type == ResultType.BulkString) { - var arr = JsonSerializer.Deserialize(res.ToString()!); - if (arr?.Length > 0) + var arr = JsonSerializer.Deserialize(res.ToString()!); + if (arr?.Count > 0) { return JsonSerializer.Deserialize(JsonSerializer.Serialize(arr[0])); } diff --git a/src/NRedisStack/Json/JsonCommandsAsync.cs b/src/NRedisStack/Json/JsonCommandsAsync.cs index 3dcfdb81..12d0e5fc 100644 --- a/src/NRedisStack/Json/JsonCommandsAsync.cs +++ b/src/NRedisStack/Json/JsonCommandsAsync.cs @@ -1,6 +1,6 @@ using StackExchange.Redis; using System.Text.Json; -// using System.Text.Json.Nodes; +using System.Text.Json.Nodes; namespace NRedisStack; @@ -82,8 +82,8 @@ public async Task GetAsync(RedisKey key, string[] paths, RedisValue var res = await _db.ExecuteAsync(JsonCommandBuilder.Get(key, path)); if (res.Type == ResultType.BulkString) { - var arr = JsonSerializer.Deserialize(res.ToString()!); - if (arr?.Length > 0) + var arr = JsonSerializer.Deserialize(res.ToString()!); + if (arr?.Count > 0) { return JsonSerializer.Deserialize(JsonSerializer.Serialize(arr[0])); } @@ -92,7 +92,6 @@ public async Task GetAsync(RedisKey key, string[] paths, RedisValue return default; } - /// public async Task> GetEnumerableAsync(RedisKey key, string path = "$") { diff --git a/src/NRedisStack/NRedisStack.csproj b/src/NRedisStack/NRedisStack.csproj index 782b384b..d993c79e 100644 --- a/src/NRedisStack/NRedisStack.csproj +++ b/src/NRedisStack/NRedisStack.csproj @@ -15,7 +15,7 @@ - + From 8233ccd9ae3ebef482bce1e8f538b1d04dd65ad9 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 13 Mar 2023 08:34:44 -0400 Subject: [PATCH 04/41] adjustments to run in .NET Framework, adding job to run tests for .NET Framework --- .github/workflows/integration.yml | 17 ++++++++++++++++- src/NRedisStack/ResponseParser.cs | 2 ++ src/NRedisStack/Tdigest/TdigestCommands.cs | 4 +++- .../NRedisStack.Tests/NRedisStack.Tests.csproj | 3 ++- tests/NRedisStack.Tests/Tdigest/TdigestTests.cs | 8 ++++++-- .../TimeSeries/TestAPI/TestMADD.cs | 3 ++- .../TimeSeries/TestAPI/TestMAddAsync.cs | 3 ++- 7 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4d0ddcf9..618b362d 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -16,6 +16,19 @@ env: jobs: + windows: + name: windows + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: run redis-stack-server docker + run: docker run -p 6379:6379 -d redis/redis-stack-server:edge + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true + - name: Test + run: dotnet test --no-build --verbosity normal -f net481 build_and_test: name: Build and test runs-on: ubuntu-latest @@ -35,8 +48,10 @@ jobs: run: dotnet restore - name: Build run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true + - name: Test + run: dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Test - run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + run: dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Codecov uses: codecov/codecov-action@v3 with: diff --git a/src/NRedisStack/ResponseParser.cs b/src/NRedisStack/ResponseParser.cs index d96c20fd..a8b0fd85 100644 --- a/src/NRedisStack/ResponseParser.cs +++ b/src/NRedisStack/ResponseParser.cs @@ -47,6 +47,8 @@ public static long ToLong(this RedisResult result) public static double ToDouble(this RedisResult result) { + if (result.ToString() == "nan") + return double.NaN; if ((double?)result == null) throw new ArgumentNullException(nameof(result)); return (double)result; diff --git a/src/NRedisStack/Tdigest/TdigestCommands.cs b/src/NRedisStack/Tdigest/TdigestCommands.cs index 9ee9fd56..72d5f847 100644 --- a/src/NRedisStack/Tdigest/TdigestCommands.cs +++ b/src/NRedisStack/Tdigest/TdigestCommands.cs @@ -44,7 +44,9 @@ public double Max(RedisKey key) /// public double Min(RedisKey key) { - return _db.Execute(TdigestCommandBuilder.Min(key)).ToDouble(); + var cmd = TdigestCommandBuilder.Min(key); + var res =_db.Execute(cmd); + return res.ToDouble(); } /// diff --git a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj index 01c824f8..d2cc16f6 100644 --- a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj +++ b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj @@ -1,9 +1,10 @@ - net6.0;net7.0 + net6.0;net7.0;net462 enable enable + latest false diff --git a/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs b/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs index eb8d43a1..c1592a66 100644 --- a/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs +++ b/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs @@ -666,7 +666,7 @@ static Tuple RandomValueWeight() { Random random = new Random(); - return new Tuple(random.NextDouble() * 10000, random.NextInt64() + 1); + return new Tuple(random.NextDouble() * 10000, random.Next() + 1); } static Tuple[] RandomValueWeightArray(int count) @@ -687,7 +687,11 @@ static Tuple DefinedValueWeight(double value, long weight) private static double[] WeightedValue(double value, int weight) { double[] values = new double[weight]; - Array.Fill(values, value); + for (var i = 0; i < values.Length; i++) + { + values[i] = value; + } + return values; } } diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs index 83920a69..5aa329bd 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs @@ -1,4 +1,5 @@ using NRedisStack.DataTypes; +using NRedisStack.Literals.Enums; using NRedisStack.RedisStackCommands; using StackExchange.Redis; using Xunit; @@ -88,7 +89,7 @@ public void TestOverrideMADD() foreach (string key in keys) { - ts.Create(key); + ts.Create(key, duplicatePolicy: TsDuplicatePolicy.MAX); } List oldTimeStamps = new List(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs index 5c7fa550..7778accf 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs @@ -1,4 +1,5 @@ using NRedisStack.DataTypes; +using NRedisStack.Literals.Enums; using NRedisStack.RedisStackCommands; using StackExchange.Redis; using Xunit; @@ -82,7 +83,7 @@ public async Task TestOverrideMAdd() foreach (var key in keys) { - await ts.CreateAsync(key); + await ts.CreateAsync(key, duplicatePolicy: TsDuplicatePolicy.MAX); } var oldTimeStamps = new List(); From a4fcf104e0577cab26aae67d0c5d46c8d0a941a2 Mon Sep 17 00:00:00 2001 From: Steve Lorello <42971704+slorello89@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:07:30 -0400 Subject: [PATCH 05/41] adjustments to run in .NET Framework, adding job to run tests for .NET Framework (#91) --- .github/workflows/integration.yml | 17 ++++++++++++++++- src/NRedisStack/ResponseParser.cs | 2 ++ src/NRedisStack/Tdigest/TdigestCommands.cs | 4 +++- .../NRedisStack.Tests/NRedisStack.Tests.csproj | 3 ++- tests/NRedisStack.Tests/Tdigest/TdigestTests.cs | 8 ++++++-- .../TimeSeries/TestAPI/TestMADD.cs | 3 ++- .../TimeSeries/TestAPI/TestMAddAsync.cs | 3 ++- 7 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4d0ddcf9..618b362d 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -16,6 +16,19 @@ env: jobs: + windows: + name: windows + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: run redis-stack-server docker + run: docker run -p 6379:6379 -d redis/redis-stack-server:edge + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true + - name: Test + run: dotnet test --no-build --verbosity normal -f net481 build_and_test: name: Build and test runs-on: ubuntu-latest @@ -35,8 +48,10 @@ jobs: run: dotnet restore - name: Build run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true + - name: Test + run: dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Test - run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + run: dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Codecov uses: codecov/codecov-action@v3 with: diff --git a/src/NRedisStack/ResponseParser.cs b/src/NRedisStack/ResponseParser.cs index d96c20fd..a8b0fd85 100644 --- a/src/NRedisStack/ResponseParser.cs +++ b/src/NRedisStack/ResponseParser.cs @@ -47,6 +47,8 @@ public static long ToLong(this RedisResult result) public static double ToDouble(this RedisResult result) { + if (result.ToString() == "nan") + return double.NaN; if ((double?)result == null) throw new ArgumentNullException(nameof(result)); return (double)result; diff --git a/src/NRedisStack/Tdigest/TdigestCommands.cs b/src/NRedisStack/Tdigest/TdigestCommands.cs index 9ee9fd56..72d5f847 100644 --- a/src/NRedisStack/Tdigest/TdigestCommands.cs +++ b/src/NRedisStack/Tdigest/TdigestCommands.cs @@ -44,7 +44,9 @@ public double Max(RedisKey key) /// public double Min(RedisKey key) { - return _db.Execute(TdigestCommandBuilder.Min(key)).ToDouble(); + var cmd = TdigestCommandBuilder.Min(key); + var res =_db.Execute(cmd); + return res.ToDouble(); } /// diff --git a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj index 01c824f8..d2cc16f6 100644 --- a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj +++ b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj @@ -1,9 +1,10 @@ - net6.0;net7.0 + net6.0;net7.0;net462 enable enable + latest false diff --git a/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs b/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs index eb8d43a1..c1592a66 100644 --- a/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs +++ b/tests/NRedisStack.Tests/Tdigest/TdigestTests.cs @@ -666,7 +666,7 @@ static Tuple RandomValueWeight() { Random random = new Random(); - return new Tuple(random.NextDouble() * 10000, random.NextInt64() + 1); + return new Tuple(random.NextDouble() * 10000, random.Next() + 1); } static Tuple[] RandomValueWeightArray(int count) @@ -687,7 +687,11 @@ static Tuple DefinedValueWeight(double value, long weight) private static double[] WeightedValue(double value, int weight) { double[] values = new double[weight]; - Array.Fill(values, value); + for (var i = 0; i < values.Length; i++) + { + values[i] = value; + } + return values; } } diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs index 83920a69..5aa329bd 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs @@ -1,4 +1,5 @@ using NRedisStack.DataTypes; +using NRedisStack.Literals.Enums; using NRedisStack.RedisStackCommands; using StackExchange.Redis; using Xunit; @@ -88,7 +89,7 @@ public void TestOverrideMADD() foreach (string key in keys) { - ts.Create(key); + ts.Create(key, duplicatePolicy: TsDuplicatePolicy.MAX); } List oldTimeStamps = new List(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs index 5c7fa550..7778accf 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMAddAsync.cs @@ -1,4 +1,5 @@ using NRedisStack.DataTypes; +using NRedisStack.Literals.Enums; using NRedisStack.RedisStackCommands; using StackExchange.Redis; using Xunit; @@ -82,7 +83,7 @@ public async Task TestOverrideMAdd() foreach (var key in keys) { - await ts.CreateAsync(key); + await ts.CreateAsync(key, duplicatePolicy: TsDuplicatePolicy.MAX); } var oldTimeStamps = new List(); From 6fee86dac4c5290104d37a86c401302e6fd16bf7 Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Mon, 13 Mar 2023 15:13:16 +0200 Subject: [PATCH 06/41] syntax fix --- .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 618b362d..99ce9d45 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,7 +48,7 @@ jobs: run: dotnet restore - name: Build run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - - name: Test + - name: Test run: dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Test run: dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover From ba18d9797516800ac83f321eca2f000b2c9c2c08 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 13 Mar 2023 09:50:55 -0400 Subject: [PATCH 07/41] trying to manually switch to linux containers --- .github/workflows/integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 99ce9d45..4ee0911f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -21,6 +21,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 + - run: $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchLinuxEngine - name: run redis-stack-server docker run: docker run -p 6379:6379 -d redis/redis-stack-server:edge - name: Restore dependencies From cb6d25f0ad3484b98140550732f7257f73e89a8a Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 13 Mar 2023 09:55:02 -0400 Subject: [PATCH 08/41] trying other format --- .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 4ee0911f..56727efe 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -21,7 +21,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - run: $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchLinuxEngine + - run: "& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchLinuxEngine" - name: run redis-stack-server docker run: docker run -p 6379:6379 -d redis/redis-stack-server:edge - name: Restore dependencies From 249c59e498a88edbec30311aecf95ffed6a25c32 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 13 Mar 2023 09:57:33 -0400 Subject: [PATCH 09/41] fixing syntax --- .github/workflows/integration.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 56727efe..c98bc71d 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -21,7 +21,8 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - run: "& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchLinuxEngine" + - run: | + & 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchLinuxEngine - name: run redis-stack-server docker run: docker run -p 6379:6379 -d redis/redis-stack-server:edge - name: Restore dependencies From cc96c41493c3a0f3090e94da6b4f18a9f38d0048 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 13 Mar 2023 11:52:52 -0400 Subject: [PATCH 10/41] swapping flags --- .github/workflows/integration.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index c98bc71d..fa82102a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -21,10 +21,8 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - run: | - & 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchLinuxEngine - name: run redis-stack-server docker - run: docker run -p 6379:6379 -d redis/redis-stack-server:edge + run: docker run --platform linux -p 6379:6379 -d redis/redis-stack-server:edge - name: Restore dependencies run: dotnet restore - name: Build From 4769cc778169de6ae591a11f7fb351ee660612cf Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 13 Mar 2023 12:21:44 -0400 Subject: [PATCH 11/41] nixing windows job --- .github/workflows/integration.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index fa82102a..4dd08e74 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -15,20 +15,6 @@ env: redis_stack_version: 6.2.2-v5 jobs: - - windows: - name: windows - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: run redis-stack-server docker - run: docker run --platform linux -p 6379:6379 -d redis/redis-stack-server:edge - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - - name: Test - run: dotnet test --no-build --verbosity normal -f net481 build_and_test: name: Build and test runs-on: ubuntu-latest From 91186b50c64e39c9db502156634b95e1ed00ac45 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 13 Mar 2023 12:25:02 -0400 Subject: [PATCH 12/41] try dropping framework restrictions --- .github/workflows/integration.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4dd08e74..d77f5d4e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -35,9 +35,7 @@ jobs: - name: Build run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - - name: Test - run: dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Codecov uses: codecov/codecov-action@v3 with: From 5e4ade56ecae6c78443db00f83eb9480e097e369 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 13 Mar 2023 12:29:12 -0400 Subject: [PATCH 13/41] dropping 462 --- tests/NRedisStack.Tests/NRedisStack.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj index d2cc16f6..380c9226 100644 --- a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj +++ b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net462 + net6.0;net7.0 enable enable latest From cf0bf17ada80f0451dd8bab2a6d31295dcacbec4 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 08:51:17 -0400 Subject: [PATCH 14/41] trying to test on windows using WSL 2 --- .github/workflows/integration.yml | 28 +++++++++++++++++-- .../NRedisStack.Tests.csproj | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d77f5d4e..d5c0bbad 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -15,7 +15,7 @@ env: redis_stack_version: 6.2.2-v5 jobs: - build_and_test: + build_and_test_ubuntu: name: Build and test runs-on: ubuntu-latest steps: @@ -35,12 +35,34 @@ jobs: - name: Build run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + run: dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + - name: Test + run: dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Codecov uses: codecov/codecov-action@v3 with: token: ${{secrets.CODECOV_TOKEN}} verbose: true - - name: Build run: dotnet pack -c Release + + build_and_test_windows: + name: Build and Test on Widnows + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: Vampire/setup-wsl@v2 + - shell: wsl-bash {0} + run: | + curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list + sudo apt-get update + sudo apt-get install redis-stack-server + sudo mkdir /data + /opt/redis-stack/bin/redis-stack-server & + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true + - name: Test + run: dotnet test -f net481 --no-build --verbosity normal \ No newline at end of file diff --git a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj index 380c9226..e27efea6 100644 --- a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj +++ b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net481 enable enable latest From a825792d83a08f82024c1a45556a03e0af8bf19c Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 08:54:26 -0400 Subject: [PATCH 15/41] adding curl install --- .github/workflows/integration.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d5c0bbad..a4d08e1c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -54,10 +54,12 @@ jobs: - uses: Vampire/setup-wsl@v2 - shell: wsl-bash {0} run: | + sudo apt-get update + sudo apt-get install curl -y curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list sudo apt-get update - sudo apt-get install redis-stack-server + sudo apt-get install redis-stack-server -y sudo mkdir /data /opt/redis-stack/bin/redis-stack-server & - name: Restore dependencies From 9057a87707225afcfdc93744608a6aad6c518f54 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 09:01:11 -0400 Subject: [PATCH 16/41] also installing gpg. . . --- .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 a4d08e1c..3aa604fe 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -55,7 +55,7 @@ jobs: - shell: wsl-bash {0} run: | sudo apt-get update - sudo apt-get install curl -y + sudo apt-get install curl -y && sudo apt-get install gpg -y curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list sudo apt-get update From 1456dd523114c812f287b3ed624cf028f9373719 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 09:04:17 -0400 Subject: [PATCH 17/41] and lsb-release... --- .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 3aa604fe..292e5c1b 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -55,7 +55,7 @@ jobs: - shell: wsl-bash {0} run: | sudo apt-get update - sudo apt-get install curl -y && sudo apt-get install gpg -y + sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list sudo apt-get update From 3b109c08b6d008b706e14f55d58a0e8317fcd6e7 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 09:32:24 -0400 Subject: [PATCH 18/41] trying to log start --- .github/workflows/integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 292e5c1b..906fb30f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -60,8 +60,8 @@ jobs: echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list sudo apt-get update sudo apt-get install redis-stack-server -y - sudo mkdir /data - /opt/redis-stack/bin/redis-stack-server & + /opt/redis-stack/bin/redis-stack-server >redisout.log 2>&1 & + cat redisout.log - name: Restore dependencies run: dotnet restore - name: Build From c01249b2475885785a7d4ae0153ca5a948334658 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 09:57:46 -0400 Subject: [PATCH 19/41] switching to ubuntu --- .github/workflows/integration.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 906fb30f..03bd82e7 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -52,6 +52,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: Vampire/setup-wsl@v2 + with: + distribution: Ubuntu-20.04 - shell: wsl-bash {0} run: | sudo apt-get update From c532b10ed47bf39632f5014b54e668108588775e Mon Sep 17 00:00:00 2001 From: shacharPash Date: Tue, 14 Mar 2023 16:05:25 +0200 Subject: [PATCH 20/41] change test name --- .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 03bd82e7..d640dd67 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -16,7 +16,7 @@ env: jobs: build_and_test_ubuntu: - name: Build and test + name: Build and Test on Ubuntu runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From bf0bf8a4eaa73a1e9df36df53df10d779558d93a Mon Sep 17 00:00:00 2001 From: shacharPash Date: Tue, 14 Mar 2023 16:27:17 +0200 Subject: [PATCH 21/41] delete distribution: Ubuntu-20.04 line --- .github/workflows/integration.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d640dd67..040c8678 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -47,13 +47,11 @@ jobs: run: dotnet pack -c Release build_and_test_windows: - name: Build and Test on Widnows + name: Build and Test on Windows runs-on: windows-latest steps: - uses: actions/checkout@v3 - uses: Vampire/setup-wsl@v2 - with: - distribution: Ubuntu-20.04 - shell: wsl-bash {0} run: | sudo apt-get update From cfcc786aac56bcf6bb4e7ac2e08b7d084df50eb9 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Tue, 14 Mar 2023 17:26:02 +0200 Subject: [PATCH 22/41] experiment --- .github/workflows/integration.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 040c8678..21f7ae65 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -50,18 +50,14 @@ jobs: name: Build and Test on Windows runs-on: windows-latest steps: - - uses: actions/checkout@v3 - - uses: Vampire/setup-wsl@v2 - - shell: wsl-bash {0} - run: | - sudo apt-get update - sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y - curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list - sudo apt-get update - sudo apt-get install redis-stack-server -y - /opt/redis-stack/bin/redis-stack-server >redisout.log 2>&1 & - cat redisout.log + - name: Download redis-stack + run: Invoke-WebRequest https://github.com/ianwalter/redis-stack/releases/latest/download/redis-stack.zip -OutFile redis-stack.zip + - name: Extract redis-stack + run: Expand-Archive redis-stack.zip -DestinationPath .\redis-stack\ + - name: Start redis-stack + run: .\redis-stack\redis-stack.exe start + - name: Wait for redis-stack to start + run: Start-Sleep -s 5 - name: Restore dependencies run: dotnet restore - name: Build From 9488210334c27a8c7b5f60f9d681fdc68a21b5c9 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 16:08:04 -0400 Subject: [PATCH 23/41] trying with direct tar download --- .github/workflows/integration.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 21f7ae65..e3ba95be 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -50,14 +50,18 @@ jobs: name: Build and Test on Windows runs-on: windows-latest steps: - - name: Download redis-stack - run: Invoke-WebRequest https://github.com/ianwalter/redis-stack/releases/latest/download/redis-stack.zip -OutFile redis-stack.zip - - name: Extract redis-stack - run: Expand-Archive redis-stack.zip -DestinationPath .\redis-stack\ - - name: Start redis-stack - run: .\redis-stack\redis-stack.exe start - - name: Wait for redis-stack to start - run: Start-Sleep -s 5 + - uses: actions/checkout@v3 + - uses: Vampire/setup-wsl@v2 + - shell: wsl-bash {0} + run: | + sudo apt-get update + sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y + curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list + sudo apt-get update + sudo apt-get install redis-stack-server -y + /opt/redis-stack/bin/redis-stack-server >redisout.log 2>&1 & + cat redisout.log - name: Restore dependencies run: dotnet restore - name: Build From b0a524c26e538e6816ca272cb5ff3824f0cf8f0e Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 16:10:00 -0400 Subject: [PATCH 24/41] ok let's actually add it this time --- .github/workflows/integration.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e3ba95be..2e6b7c44 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -50,17 +50,17 @@ jobs: name: Build and Test on Windows runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - uses: Vampire/setup-wsl@v2 - - shell: wsl-bash {0} + - name: Configure Redis + shell: wsl-bash {0} run: | sudo apt-get update sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y - curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list - sudo apt-get update - sudo apt-get install redis-stack-server -y - /opt/redis-stack/bin/redis-stack-server >redisout.log 2>&1 & + curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz + tar xf redis-stack.tar.gz + sudo mv redis-stack-server-6.2.6-v6/ /opt/redis-stack-server + /opt/redis-stack-server/bin/redis-stack-server >redisout.log 2>&1 & cat redisout.log - name: Restore dependencies run: dotnet restore From 7137f09b2648924a0b17fd1b52cce87b9dcb3f26 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 16:15:40 -0400 Subject: [PATCH 25/41] resetting as a jammy instance, adding a ls for debugging --- .github/workflows/integration.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2e6b7c44..bbb0109a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -52,6 +52,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: Vampire/setup-wsl@v2 + with: + distribution: Ubuntu-22.04 - name: Configure Redis shell: wsl-bash {0} run: | @@ -59,6 +61,7 @@ jobs: sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz tar xf redis-stack.tar.gz + ls -l sudo mv redis-stack-server-6.2.6-v6/ /opt/redis-stack-server /opt/redis-stack-server/bin/redis-stack-server >redisout.log 2>&1 & cat redisout.log From 3121220022835852f4a41f66d389078a0224d089 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 16:19:18 -0400 Subject: [PATCH 26/41] removing mv --- .github/workflows/integration.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index bbb0109a..ca52b99f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -62,8 +62,7 @@ jobs: curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz tar xf redis-stack.tar.gz ls -l - sudo mv redis-stack-server-6.2.6-v6/ /opt/redis-stack-server - /opt/redis-stack-server/bin/redis-stack-server >redisout.log 2>&1 & + ./redis-stack-server-6.2.6-v6/bin/redis-stack-server >redisout.log 2>&1 & cat redisout.log - name: Restore dependencies run: dotnet restore From 72d2d0c1294184b87378688829682158990edc2a Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 16:29:29 -0400 Subject: [PATCH 27/41] removing process spinoff --- .github/workflows/integration.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index ca52b99f..8f9d402f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -62,8 +62,10 @@ jobs: curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz tar xf redis-stack.tar.gz ls -l - ./redis-stack-server-6.2.6-v6/bin/redis-stack-server >redisout.log 2>&1 & - cat redisout.log + ./redis-stack-server-6.2.6-v6/bin/redis-stack-server + - name: Check Redis + shell: wsl-bash {0} + run: ps -ef | grep redis - name: Restore dependencies run: dotnet restore - name: Build From b56c34fdd00a08dc221be6cc06d2d87e15070976 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 16:30:12 -0400 Subject: [PATCH 28/41] fixing syntax --- .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 8f9d402f..da68dd38 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -65,7 +65,7 @@ jobs: ./redis-stack-server-6.2.6-v6/bin/redis-stack-server - name: Check Redis shell: wsl-bash {0} - run: ps -ef | grep redis + run: ps -ef | grep redis - name: Restore dependencies run: dotnet restore - name: Build From 4d5dde23f4ef376e8fe225271f7d11026d308e4e Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 16:36:47 -0400 Subject: [PATCH 29/41] libgomp1? --- .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 da68dd38..12684ba8 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -58,7 +58,7 @@ jobs: shell: wsl-bash {0} run: | sudo apt-get update - sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y + sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y && apt-get install libgomp1 -y curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz tar xf redis-stack.tar.gz ls -l From e206725b535f8fc3d8926b2f6873ea8648c32fff Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 16:43:43 -0400 Subject: [PATCH 30/41] spin off again --- .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 12684ba8..8dcc0a92 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -62,7 +62,7 @@ jobs: curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz tar xf redis-stack.tar.gz ls -l - ./redis-stack-server-6.2.6-v6/bin/redis-stack-server + ./redis-stack-server-6.2.6-v6/bin/redis-stack-server & - name: Check Redis shell: wsl-bash {0} run: ps -ef | grep redis From ae849fcf511e7007ed24d06d1119a822066ca900 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 16:50:36 -0400 Subject: [PATCH 31/41] trying a new tact for spinning off process --- .github/workflows/integration.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8dcc0a92..378f9ad8 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -54,21 +54,19 @@ jobs: - uses: Vampire/setup-wsl@v2 with: distribution: Ubuntu-22.04 - - name: Configure Redis + - name: Install Redis shell: wsl-bash {0} run: | sudo apt-get update sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y && apt-get install libgomp1 -y curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz - tar xf redis-stack.tar.gz - ls -l - ./redis-stack-server-6.2.6-v6/bin/redis-stack-server & - - name: Check Redis - shell: wsl-bash {0} - run: ps -ef | grep redis + tar xf redis-stack.tar.gz - name: Restore dependencies run: dotnet restore - name: Build run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: Test - run: dotnet test -f net481 --no-build --verbosity normal \ No newline at end of file + shell: cmd + run: | + wsl ./redis-stack-server-6.2.6-v6/bin/redis-stack-server & + dotnet test -f net481 --no-build --verbosity normal \ No newline at end of file From f193985d722ee13e6a7d5404f2da31fc0e03c6ac Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 14 Mar 2023 17:02:23 -0400 Subject: [PATCH 32/41] old school spin off? --- .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 378f9ad8..efe0eea8 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -68,5 +68,5 @@ jobs: - name: Test shell: cmd run: | - wsl ./redis-stack-server-6.2.6-v6/bin/redis-stack-server & + START wsl ./redis-stack-server-6.2.6-v6/bin/redis-stack-server & dotnet test -f net481 --no-build --verbosity normal \ No newline at end of file From 6dde211d1d9e7e7fa905a3c90962e58d32bdf99b Mon Sep 17 00:00:00 2001 From: slorello89 Date: Wed, 15 Mar 2023 07:13:03 -0400 Subject: [PATCH 33/41] renaming --- .github/workflows/integration.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index efe0eea8..55e386a3 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -15,7 +15,7 @@ env: redis_stack_version: 6.2.2-v5 jobs: - build_and_test_ubuntu: + build_and_test: name: Build and Test on Ubuntu runs-on: ubuntu-latest steps: @@ -45,7 +45,6 @@ jobs: verbose: true - name: Build run: dotnet pack -c Release - build_and_test_windows: name: Build and Test on Windows runs-on: windows-latest From 05c580d0d3247e04abb44620310b8de9efb90932 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Wed, 15 Mar 2023 07:34:54 -0400 Subject: [PATCH 34/41] versioning --- .github/workflows/integration.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 55e386a3..48ee8f34 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -12,11 +12,11 @@ on: - cron: "0 1 * * *" env: - redis_stack_version: 6.2.2-v5 + redis_stack_version: 6.2.6-v6 jobs: - build_and_test: - name: Build and Test on Ubuntu + build_and_Test: + name: Build and test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -58,7 +58,7 @@ jobs: run: | sudo apt-get update sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y && apt-get install libgomp1 -y - curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz + curl https://packages.redis.io/redis-stack/redis-stack-server-$redis_stack_version.jammy.x86_64.tar.gz -o redis-stack.tar.gz tar xf redis-stack.tar.gz - name: Restore dependencies run: dotnet restore @@ -67,5 +67,5 @@ jobs: - name: Test shell: cmd run: | - START wsl ./redis-stack-server-6.2.6-v6/bin/redis-stack-server & + START wsl ./redis-stack-server-$redis_stack_version/bin/redis-stack-server & dotnet test -f net481 --no-build --verbosity normal \ No newline at end of file From e4f6a6bb04d3baa4863d94227961b43cc62668ff Mon Sep 17 00:00:00 2001 From: slorello89 Date: Wed, 15 Mar 2023 07:40:12 -0400 Subject: [PATCH 35/41] newline --- .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 48ee8f34..fa552d02 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -68,4 +68,4 @@ jobs: shell: cmd run: | START wsl ./redis-stack-server-$redis_stack_version/bin/redis-stack-server & - dotnet test -f net481 --no-build --verbosity normal \ No newline at end of file + dotnet test -f net481 --no-build --verbosity normal From dd9e8357de8ebc50add986661f18ca822ca7c267 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Wed, 15 Mar 2023 07:44:31 -0400 Subject: [PATCH 36/41] PS variable access --- .github/workflows/integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index fa552d02..7e1b555b 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -58,7 +58,7 @@ jobs: run: | sudo apt-get update sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y && apt-get install libgomp1 -y - curl https://packages.redis.io/redis-stack/redis-stack-server-$redis_stack_version.jammy.x86_64.tar.gz -o redis-stack.tar.gz + curl https://packages.redis.io/redis-stack/redis-stack-server-$env:redis_stack_version.jammy.x86_64.tar.gz -o redis-stack.tar.gz tar xf redis-stack.tar.gz - name: Restore dependencies run: dotnet restore @@ -67,5 +67,5 @@ jobs: - name: Test shell: cmd run: | - START wsl ./redis-stack-server-$redis_stack_version/bin/redis-stack-server & + START wsl ./redis-stack-server-$env:redis_stack_version/bin/redis-stack-server & dotnet test -f net481 --no-build --verbosity normal From 4094afec812e8d3746d496a6da4e4f40608a5305 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Wed, 15 Mar 2023 08:03:22 -0400 Subject: [PATCH 37/41] reverting --- .github/workflows/integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7e1b555b..2da078ab 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -58,7 +58,7 @@ jobs: run: | sudo apt-get update sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y && apt-get install libgomp1 -y - curl https://packages.redis.io/redis-stack/redis-stack-server-$env:redis_stack_version.jammy.x86_64.tar.gz -o redis-stack.tar.gz + curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz tar xf redis-stack.tar.gz - name: Restore dependencies run: dotnet restore @@ -67,5 +67,5 @@ jobs: - name: Test shell: cmd run: | - START wsl ./redis-stack-server-$env:redis_stack_version/bin/redis-stack-server & + START wsl ./redis-stack-server-6.2.6-v6/bin/redis-stack-server & dotnet test -f net481 --no-build --verbosity normal From 1b200130b0bca355a9baaaa00b45be7e6e7101ec Mon Sep 17 00:00:00 2001 From: slorello89 Date: Wed, 15 Mar 2023 08:07:54 -0400 Subject: [PATCH 38/41] other means of seeding env vars? --- .github/workflows/integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2da078ab..a3e3b094 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -58,7 +58,7 @@ jobs: run: | sudo apt-get update sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y && apt-get install libgomp1 -y - curl https://packages.redis.io/redis-stack/redis-stack-server-6.2.6-v6.jammy.x86_64.tar.gz -o redis-stack.tar.gz + curl https://packages.redis.io/redis-stack/redis-stack-server-${{env.redis_stack_version}}.jammy.x86_64.tar.gz -o redis-stack.tar.gz tar xf redis-stack.tar.gz - name: Restore dependencies run: dotnet restore @@ -67,5 +67,5 @@ jobs: - name: Test shell: cmd run: | - START wsl ./redis-stack-server-6.2.6-v6/bin/redis-stack-server & + START wsl ./redis-stack-server-${{env.redis_stack_version}}/bin/redis-stack-server & dotnet test -f net481 --no-build --verbosity normal From 4643fbf4b2f6f780f31f05b677fde42fb99cf1b3 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Wed, 15 Mar 2023 14:27:42 +0200 Subject: [PATCH 39/41] add sleep to HSETandSearch test --- tests/NRedisStack.Tests/Examples/ExamplesTests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/NRedisStack.Tests/Examples/ExamplesTests.cs b/tests/NRedisStack.Tests/Examples/ExamplesTests.cs index d9428516..5e69078b 100644 --- a/tests/NRedisStack.Tests/Examples/ExamplesTests.cs +++ b/tests/NRedisStack.Tests/Examples/ExamplesTests.cs @@ -46,6 +46,9 @@ public void HSETandSearch() // Create the index ft.Create("example_index", parameters, schema); + //sleep: + System.Threading.Thread.Sleep(2000); + // Search all hashes in the index var noFilters = ft.Search("example_index", new Query()); // noFilters now contains: student:1111, student:5555, pupil:4444, student:3333 @@ -61,7 +64,7 @@ public void HSETandSearch() // Search for hashes with last name of Rod var lastNameRod = ft.Search("example_index", new Query("@last:Rod")); // lastNameRod is empty because there are no hashes with a last name of Rod that match the index definition - // Assert.Equal(4, noFilters.TotalResults); TODO: checl why this fails in the CI sometimes + Assert.Equal(4, noFilters.TotalResults); Assert.Equal(2, startWithJo.TotalResults); Assert.Equal(1, namedPat.TotalResults); Assert.Equal(0, lastNameRod.TotalResults); From e10b00e9f97b01c8f5c0cec1d83db3d92943c69f Mon Sep 17 00:00:00 2001 From: shacharPash Date: Wed, 15 Mar 2023 14:35:59 +0200 Subject: [PATCH 40/41] add sleep to TestQueryCommandBuilderScore Test --- tests/NRedisStack.Tests/Search/SearchTests.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/NRedisStack.Tests/Search/SearchTests.cs b/tests/NRedisStack.Tests/Search/SearchTests.cs index 19e01990..d89b1f48 100644 --- a/tests/NRedisStack.Tests/Search/SearchTests.cs +++ b/tests/NRedisStack.Tests/Search/SearchTests.cs @@ -1755,6 +1755,9 @@ public void TestQueryCommandBuilderScore() db.Execute("JSON.SET", "doc:1", "$", "[{\"arr\": [1, 2, 3]}, {\"val\": \"hello\"}, {\"val\": \"world\"}]"); db.Execute("FT.CREATE", "idx", "ON", "JSON", "PREFIX", "1", "doc:", "SCHEMA", "$..arr", "AS", "arr", "NUMERIC", "$..val", "AS", "val", "TEXT"); + // sleep: + Thread.Sleep(2000); + var res = ft.Search("idx", new Query("*").ReturnFields("arr", "val").SetWithScores().SetPayload("arr")); Assert.Equal(1, res.TotalResults); } From 3e1f59861b11f63d558b7ec1b797eb7c1aa711da Mon Sep 17 00:00:00 2001 From: slorello89 Date: Wed, 15 Mar 2023 08:40:15 -0400 Subject: [PATCH 41/41] conditional framework usage based on platform --- tests/NRedisStack.Tests/NRedisStack.Tests.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj index e27efea6..a11d6366 100644 --- a/tests/NRedisStack.Tests/NRedisStack.Tests.csproj +++ b/tests/NRedisStack.Tests/NRedisStack.Tests.csproj @@ -1,7 +1,8 @@ - - net6.0;net7.0;net481 + $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Windows()))) + net6.0;net7.0;net481 + net6.0;net7.0 enable enable latest