Skip to content

Commit be3bbfd

Browse files
committed
upgrade packages and finish cleaning output
1 parent 29e74b4 commit be3bbfd

38 files changed

+124
-77
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<CheckEolTargetFramework>false</CheckEolTargetFramework>
2222
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
2323
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
24+
<SuppressTfmSupportBuildErrors>true</SuppressTfmSupportBuildErrors>
2425
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
2526
<NoWarn>$(NoWarn);CS1591</NoWarn>
2627
<IsWindows>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Windows())))</IsWindows>

Directory.Packages.props

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
<Project>
2-
<ItemGroup>
3-
<!-- core build -->
4-
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0"/>
5-
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3"/>
6-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0"/>
7-
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.7.115"/>
8-
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4"/>
9-
10-
<!-- primary library -->
11-
<PackageVersion Include="NetTopologySuite" Version="2.5.0"/>
12-
<PackageVersion Include="System.Text.Json" Version="9.0.2"/>
13-
<PackageVersion Include="StackExchange.Redis" Version="2.8.24"/>
14-
15-
<!-- tests, etc -->
16-
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.5.1"/>
17-
<PackageVersion Include="coverlet.collector" Version="6.0.4"/>
18-
<PackageVersion Include="coverlet.msbuild" Version="6.0.4"/>
19-
<PackageVersion Include="dotenv.net" Version="3.2.1"/>
20-
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1"/>
21-
<PackageVersion Include="Microsoft.Azure.StackExchangeRedis" Version="3.1.0"/>
22-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
23-
<PackageVersion Include="Validation" Version="2.6.68"/>
24-
<PackageVersion Include="xunit" Version="2.9.3"/>
25-
<PackageVersion Include="xunit.assert" Version="2.9.3"/>
26-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2"/>
27-
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.23"/>
28-
</ItemGroup>
2+
<ItemGroup>
3+
<!-- core build -->
4+
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
5+
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
6+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
7+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.7.115" />
8+
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0">
9+
<PrivateAssets>all</PrivateAssets>
10+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
11+
</PackageVersion>
12+
<!-- primary library -->
13+
<PackageVersion Include="NetTopologySuite" Version="2.6.0" />
14+
<PackageVersion Include="System.Text.Json" Version="9.0.7" />
15+
<PackageVersion Include="StackExchange.Redis" Version="2.8.58" />
16+
<!-- tests, etc -->
17+
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.1" />
18+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
19+
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
20+
<PackageVersion Include="dotenv.net" Version="4.0.0" />
21+
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
22+
<PackageVersion Include="Microsoft.Azure.StackExchangeRedis" Version="3.2.1" />
23+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
24+
<PackageVersion Include="Validation" Version="2.6.68" />
25+
<PackageVersion Include="xunit" Version="2.9.3" />
26+
<PackageVersion Include="xunit.assert" Version="2.9.3" />
27+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.3">
28+
<PrivateAssets>all</PrivateAssets>
29+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
30+
</PackageVersion>
31+
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.23" />
32+
</ItemGroup>
2933
</Project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
#nullable enable
2+
~override NRedisStack.DataTypes.TimeStamp.ToString() -> string
3+
~override NRedisStack.DataTypes.TimeStamp.Equals(object obj) -> bool
4+
NRedisStack.DataTypes.TimeStamp.Equals(NRedisStack.DataTypes.TimeStamp other) -> bool
5+
static NRedisStack.DataTypes.TimeStamp.operator ==(NRedisStack.DataTypes.TimeStamp left, NRedisStack.DataTypes.TimeStamp right) -> bool
6+
static NRedisStack.DataTypes.TimeStamp.operator !=(NRedisStack.DataTypes.TimeStamp left, NRedisStack.DataTypes.TimeStamp right) -> bool

tests/Doc/Doc.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<TargetFrameworks Condition=" '$(IsWindows)' == 'true'">net6.0;net7.0;net8.0;net481</TargetFrameworks>
44
<TargetFrameworks Condition=" '$(IsWindows)' != 'true'">net6.0;net7.0;net8.0</TargetFrameworks>
55
<IsPackable>false</IsPackable>
6+
7+
<!-- don't warn about obsolete APIs, or theory with no data -->
8+
<Nowarn>$(Nowarn);CS0612;CS0618;xUnit1006</Nowarn>
69
</PropertyGroup>
710
<ItemGroup>
811
<PackageReference Include="GitHubActionsTestLogger">
@@ -11,7 +14,7 @@
1114
</PackageReference>
1215
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
1316
<PackageReference Include="xunit"/>
14-
<PackageReference Include="xunit.runner.visualstudio">
17+
<PackageReference Include="xunit.runner.visualstudio" Condition="'$(TargetFramework)' == 'net8.0' or '$(TargetFramework)' == 'net481'">
1518
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1619
<PrivateAssets>all</PrivateAssets>
1720
</PackageReference>

tests/Doc/PipeTransExample.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public PipeTransExample(EndpointsFixture fixture) : base(fixture) { }
1717

1818
[SkippableFact]
1919
// REMOVE_END
20-
public async Task run()
20+
public void run()
2121
{
2222
//REMOVE_START
2323
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
2424
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
25-
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
25+
_ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
2626
//REMOVE_END
2727
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
2828
var db = muxer.GetDatabase();
@@ -40,7 +40,7 @@ public async Task run()
4040

4141
for (int i = 0; i < 5; i++)
4242
{
43-
pipeline.Db.StringSetAsync($"seat:{i}", $"#{i}");
43+
_ = pipeline.Db.StringSetAsync($"seat:{i}", $"#{i}");
4444
}
4545
pipeline.Execute();
4646

@@ -62,9 +62,9 @@ public async Task run()
6262
// STEP_START basic_trans
6363
var trans = new Transaction(db);
6464

65-
trans.Db.StringIncrementAsync("counter:1", 1);
66-
trans.Db.StringIncrementAsync("counter:2", 2);
67-
trans.Db.StringIncrementAsync("counter:3", 3);
65+
_ = trans.Db.StringIncrementAsync("counter:1", 1);
66+
_ = trans.Db.StringIncrementAsync("counter:2", 2);
67+
_ = trans.Db.StringIncrementAsync("counter:3", 3);
6868

6969
trans.Execute();
7070

@@ -88,7 +88,7 @@ public async Task run()
8888

8989
watchedTrans.AddCondition(Condition.KeyNotExists("customer:39182"));
9090

91-
watchedTrans.Db.HashSetAsync(
91+
_ = watchedTrans.Db.HashSetAsync(
9292
"customer:39182",
9393
new HashEntry[]{
9494
new HashEntry("name", "David"),
@@ -108,11 +108,11 @@ public async Task run()
108108
Console.WriteLine(resp7); // >>> true
109109

110110
db.HashSet("Details", "SerialNumber", "12345A", When.NotExists);
111-
string resp8 = db.HashGet("Details", "SerialNumber");
111+
string resp8 = db.HashGet("Details", "SerialNumber")!;
112112
Console.WriteLine(resp8); // >>> 12345
113113

114114
db.HashSet("Details", "SerialNumber", "12345A");
115-
string resp9 = db.HashGet("Details", "SerialNumber");
115+
string resp9 = db.HashGet("Details", "SerialNumber")!;
116116
Console.WriteLine(resp9); // >>> 12345A
117117
// STEP_END
118118
// REMOVE_START

tests/NRedisStack.Tests/AbstractNRedisStackTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ public void Dispose()
9595
//Redis.GetDatabase().ExecuteBroadcast("FLUSHALL");
9696
}
9797

98-
public async Task DisposeAsync()
99-
{
100-
//var redis = Redis.GetDatabase();
101-
// await redis.KeyDeleteAsync(keyNames.Select(i => (RedisKey)i).ToArray());
102-
//await redis.ExecuteBroadcastAsync("FLUSHALL");
103-
}
98+
public Task DisposeAsync() => Task.CompletedTask;
99+
/*{
100+
var redis = Redis.GetDatabase();
101+
await redis.KeyDeleteAsync(keyNames.Select(i => (RedisKey)i).ToArray());
102+
await redis.ExecuteBroadcastAsync("FLUSHALL");
103+
}*/
104104
}

tests/NRedisStack.Tests/Examples/ExampleTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma warning disable CS0618, CS0612 // allow testing obsolete methods
12
using NRedisStack.DataTypes;
23
using NRedisStack.RedisStackCommands;
34
using NRedisStack.Search;

tests/NRedisStack.Tests/NRedisStack.Tests.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
</PackageReference>
2323
<PackageReference Include="NetTopologySuite"/>
2424
<PackageReference Include="Validation"/>
25-
<PackageReference Include="xunit.runner.visualstudio"/>
25+
<PackageReference Include="xunit.runner.visualstudio" Condition="'$(TargetFramework)' == 'net8.0' or '$(TargetFramework)' == 'net481'">
26+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
27+
<PrivateAssets>all</PrivateAssets>
28+
</PackageReference>
2629
<PackageReference Include="StackExchange.Redis"/>
2730
<PackageReference Include="xunit"/>
2831
<PackageReference Include="xunit.assert"/>

tests/NRedisStack.Tests/PipelineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public void TestJsonPipeline(string endpointId)
160160
[SkippableTheory]
161161
[MemberData(nameof(EndpointsFixture.Env.StandaloneOnly), MemberType = typeof(EndpointsFixture.Env))]
162162
[Obsolete]
163-
public async void Issue401_TestPipelineAsInitialCommand(string endpointId)
163+
public async Task Issue401_TestPipelineAsInitialCommand(string endpointId)
164164
{
165165
IDatabase db = GetCleanDatabase(endpointId);
166166

tests/NRedisStack.Tests/Search/SearchTests.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma warning disable CS0618, CS0612 // allow testing obsolete methods
12
using Xunit;
23
using StackExchange.Redis;
34
using NRedisStack.RedisStackCommands;
@@ -2807,7 +2808,7 @@ public void TestProfileSearch(string endpointId)
28072808

28082809
var profile = ft.ProfileOnSearch(index, new Query("foo"));
28092810
// Iterators profile={Type=TEXT, Time=0.0, Term=foo, Counter=1, Size=1}
2810-
var info = (RedisResult[])profile.Item2.Info;
2811+
var info = (RedisResult[])profile.Item2.Info!;
28112812
int shardsIndex = Array.FindIndex(info, item => item.ToString() == "Shards");
28122813
int coordinatorIndex = Array.FindIndex(info, item => item.ToString() == "Coordinator");
28132814
CustomAssertions.GreaterThan(shardsIndex, -1);
@@ -2829,7 +2830,7 @@ public async Task TestProfileSearchAsync(string endpointId)
28292830
new HashEntry("t2", "bar")});
28302831

28312832
var profile = await ft.ProfileOnSearchAsync(index, new Query("foo"));
2832-
var info = (RedisResult[])profile.Item2.Info;
2833+
var info = (RedisResult[])profile.Item2.Info!;
28332834
int shardsIndex = Array.FindIndex(info, item => item.ToString() == "Shards");
28342835
int coordinatorIndex = Array.FindIndex(info, item => item.ToString() == "Coordinator");
28352836
CustomAssertions.GreaterThan(shardsIndex, -1);
@@ -2889,7 +2890,7 @@ public void TestProfile(string endpointId)
28892890
var q = new Query("hello|world").SetNoContent();
28902891
var profileSearch = ft.ProfileOnSearch(index, q);
28912892
var searchRes = profileSearch.Item1;
2892-
var searchDet = (RedisResult[])profileSearch.Item2.Info;
2893+
var searchDet = (RedisResult[])profileSearch.Item2.Info!;
28932894

28942895
Assert.Equal(2, searchRes.Documents.Count);
28952896
int shardsIndex = Array.FindIndex(searchDet, item => item.ToString() == "Shards");
@@ -2901,7 +2902,7 @@ public void TestProfile(string endpointId)
29012902
var aggReq = new AggregationRequest("*").Load(FieldName.Of("t")).Apply("startswith(@t, 'hel')", "prefix");
29022903
var profileAggregate = ft.ProfileOnAggregate(index, aggReq);
29032904
var aggregateRes = profileAggregate.Item1;
2904-
var aggregateDet = (RedisResult[])profileAggregate.Item2.Info;
2905+
var aggregateDet = (RedisResult[])profileAggregate.Item2.Info!;
29052906

29062907
Assert.Equal(2, aggregateRes.TotalResults);
29072908
shardsIndex = Array.FindIndex(aggregateDet, item => item.ToString() == "Shards");
@@ -2925,7 +2926,7 @@ public async Task TestProfileAsync(string endpointId)
29252926
var q = new Query("hello|world").SetNoContent();
29262927
var profileSearch = await ft.ProfileOnSearchAsync(index, q);
29272928
var searchRes = profileSearch.Item1;
2928-
var searchDet = (RedisResult[])profileSearch.Item2.Info;
2929+
var searchDet = (RedisResult[])profileSearch.Item2.Info!;
29292930

29302931
Assert.Equal(2, searchRes.Documents.Count);
29312932
int shardsIndex = Array.FindIndex(searchDet, item => item.ToString() == "Shards");
@@ -2937,7 +2938,7 @@ public async Task TestProfileAsync(string endpointId)
29372938
var aggReq = new AggregationRequest("*").Load(FieldName.Of("t")).Apply("startswith(@t, 'hel')", "prefix");
29382939
var profileAggregate = await ft.ProfileOnAggregateAsync(index, aggReq);
29392940
var aggregateRes = profileAggregate.Item1;
2940-
var aggregateDet = (RedisResult[])profileAggregate.Item2.Info;
2941+
var aggregateDet = (RedisResult[])profileAggregate.Item2.Info!;
29412942

29422943
Assert.Equal(2, aggregateRes.TotalResults);
29432944
shardsIndex = Array.FindIndex(aggregateDet, item => item.ToString() == "Shards");
@@ -3021,7 +3022,7 @@ public void TestProfileIssue306(string endpointId)
30213022
var q = new Query("hello|world").SetNoContent();
30223023
var profileSearch = ft.ProfileOnSearch(index, q);
30233024
var searchRes = profileSearch.Item1;
3024-
var searchDet = (RedisResult[])profileSearch.Item2.Info;
3025+
var searchDet = (RedisResult[])profileSearch.Item2.Info!;
30253026

30263027
CustomAssertions.GreaterThan(searchDet.Length, 3);
30273028
Assert.Equal(2, searchRes.Documents.Count);
@@ -3031,7 +3032,7 @@ public void TestProfileIssue306(string endpointId)
30313032
var aggReq = new AggregationRequest("*").Load(FieldName.Of("t")).Apply("startswith(@t, 'hel')", "prefix");
30323033
var profileAggregate = ft.ProfileOnAggregate(index, aggReq);
30333034
var aggregateRes = profileAggregate.Item1;
3034-
var aggregateDet = (RedisResult[])profileAggregate.Item2.Info;
3035+
var aggregateDet = (RedisResult[])profileAggregate.Item2.Info!;
30353036
CustomAssertions.GreaterThan(aggregateDet.Length, 3);
30363037
Assert.Equal(2, aggregateRes.TotalResults);
30373038
}
@@ -3051,7 +3052,7 @@ public async Task TestProfileAsyncIssue306(string endpointId)
30513052
var q = new Query("hello|world").SetNoContent();
30523053
var profileSearch = await ft.ProfileOnSearchAsync(index, q);
30533054
var searchRes = profileSearch.Item1;
3054-
var searchDet = (RedisResult[])profileSearch.Item2.Info;
3055+
var searchDet = (RedisResult[])profileSearch.Item2.Info!;
30553056

30563057
CustomAssertions.GreaterThan(searchDet.Length, 3);
30573058
Assert.Equal(2, searchRes.Documents.Count);
@@ -3060,7 +3061,7 @@ public async Task TestProfileAsyncIssue306(string endpointId)
30603061
var aggReq = new AggregationRequest("*").Load(FieldName.Of("t")).Apply("startswith(@t, 'hel')", "prefix");
30613062
var profileAggregate = await ft.ProfileOnAggregateAsync(index, aggReq);
30623063
var aggregateRes = profileAggregate.Item1;
3063-
var aggregateDet = (RedisResult[])profileAggregate.Item2.Info;
3064+
var aggregateDet = (RedisResult[])profileAggregate.Item2.Info!;
30643065
CustomAssertions.GreaterThan(aggregateDet.Length, 3);
30653066
Assert.Equal(2, aggregateRes.TotalResults);
30663067
}
@@ -3438,15 +3439,15 @@ public void TestDocumentLoad_Issue352()
34383439
/// </summary>
34393440
[SkippableTheory]
34403441
[MemberData(nameof(EndpointsFixture.Env.StandaloneOnly), MemberType = typeof(EndpointsFixture.Env))]
3441-
public async void TestDocumentLoadWithDB_Issue352(string endpointId)
3442+
public async Task TestDocumentLoadWithDB_Issue352(string endpointId)
34423443
{
34433444
IDatabase db = GetCleanDatabase(endpointId);
34443445
var ft = db.FT();
34453446

34463447
Schema sc = new Schema().AddTextField("firstText", 1.0).AddTextField("lastText", 1.0).AddNumericField("ageNumeric");
34473448
Assert.True(ft.Create(index, FTCreateParams.CreateParams(), sc));
34483449

3449-
Document droppedDocument = null;
3450+
Document? droppedDocument = null;
34503451
int numberOfAttempts = 0;
34513452
do
34523453
{

0 commit comments

Comments
 (0)