Skip to content

Misc updates #1322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"erlang": "25.3",
"rabbitmq": "3.11.10"
"rabbitmq": "3.11.11"
}
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Restore
run: dotnet restore --verbosity=normal
- name: ApiGen
run: dotnet run --framework "netcoreapp3.1" --project ./projects/Apigen/Apigen.csproj --apiName:AMQP_0_9_1 ./projects/specs/amqp0-9-1.stripped.xml ./gensrc/autogenerated-api-0-9-1.cs
run: dotnet run --framework net6.0 --project ./projects/Apigen/Apigen.csproj --apiName:AMQP_0_9_1 ./projects/specs/amqp0-9-1.stripped.xml ./gensrc/autogenerated-api-0-9-1.cs
- name: Build
run: dotnet build --no-restore --verbosity=normal
- name: Test
Expand Down Expand Up @@ -85,10 +85,10 @@ jobs:
- name: Restore
run: dotnet restore --verbosity=normal
- name: ApiGen
run: dotnet run --framework "netcoreapp3.1" --project ./projects/Apigen/Apigen.csproj --apiName:AMQP_0_9_1 ./projects/specs/amqp0-9-1.stripped.xml ./gensrc/autogenerated-api-0-9-1.cs
run: dotnet run --framework net6.0 --project ./projects/Apigen/Apigen.csproj --apiName:AMQP_0_9_1 ./projects/specs/amqp0-9-1.stripped.xml ./gensrc/autogenerated-api-0-9-1.cs
- name: Build
run: dotnet build --no-restore --verbosity=normal
- name: Test
run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework "netcoreapp3.1"
run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework net6.0
env:
RABBITMQ_RABBITMQCTL_PATH: DOCKER:${{job.services.rabbitmq.id}}
6 changes: 3 additions & 3 deletions RUNNING_TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ Running individual tests and fixtures on Windows is trivial using the Visual Stu
To run a specific tests fixture on MacOS or Linux, use the NUnit filter expressions to select the tests to be run:

``` shell
dotnet test projects/Unit -f netcoreapp3.1 --filter "Name~TestAmqpUriParseFail"
dotnet test projects/Unit -f net6.0 --filter "Name~TestAmqpUriParseFail"

dotnet test projects/Unit -f netcoreapp3.1 --filter "FullyQualifiedName~RabbitMQ.Client.Unit.TestHeartbeats"
dotnet test projects/Unit -f net6.0 --filter "FullyQualifiedName~RabbitMQ.Client.Unit.TestHeartbeats"
```

## Running Tests for a Specific .NET Target

To only run tests on .NET Core:

``` shell
dotnet test -f netcoreapp3.1 projects/Unit
dotnet test -f net6.0 projects/Unit
```
2 changes: 1 addition & 1 deletion projects/Apigen/Apigen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 6 additions & 5 deletions projects/RabbitMQ.Client/RabbitMQ.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyTitle>RabbitMQ Client Library for .NET</AssemblyTitle>
Expand Down Expand Up @@ -53,15 +54,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />

<PackageReference Include="MinVer" Version="2.4.0" PrivateAssets="All" />
<PackageReference Include="System.Threading.Channels" Version="4.7.1" />
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />
<PackageReference Include="System.Threading.Channels" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions projects/RabbitMQ.Client/client/impl/TcpClientAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public virtual async Task ConnectAsync(string host, int port)
throw new ArgumentException($"No ip address could be resolved for {host}");
}

#if NET461
#if NET461 || NET462
await Task.Run(() => _sock.Connect(ep, port)).ConfigureAwait(false);
#else
await _sock.ConnectAsync(ep, port).ConfigureAwait(false);
Expand Down Expand Up @@ -78,7 +78,7 @@ public virtual bool Connected
{
get
{
if(_sock == null) return false;
if (_sock == null) return false;
return _sock.Connected;
}
}
Expand All @@ -99,7 +99,7 @@ public virtual TimeSpan ReceiveTimeout

private void AssertSocket()
{
if(_sock == null)
if (_sock == null)
{
throw new InvalidOperationException("Cannot perform operation as socket is null");
}
Expand Down
3 changes: 1 addition & 2 deletions projects/Unit/TestConnectionRecovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

using System;
using System.Collections.Generic;
using System.ServiceModel.Channels;
using System.Text;
using System.Threading;

Expand Down Expand Up @@ -827,7 +826,7 @@ public void TestUnbindQueueAfterRecoveryConnection()
Assert.IsTrue(nameBefore.StartsWith("amq."));
Assert.IsTrue(nameAfter.StartsWith("amq."));
Assert.AreNotEqual(nameBefore, nameAfter);
Model.QueueUnbind(nameAfter,x,"");
Model.QueueUnbind(nameAfter, x, "");
Model.QueueDeleteNoWait(nameAfter);
latch.Reset();
CloseAndWaitForRecovery();
Expand Down
13 changes: 6 additions & 7 deletions projects/Unit/Unit.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net462;net6.0</TargetFrameworks>
<AssemblyOriginatorKeyFile>../rabbit.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
Expand All @@ -11,12 +11,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="PublicApiGenerator" Version="10.3.0" />
<PackageReference Include="Verify.NUnit" Version="12.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
<PackageReference Include="Verify.NUnit" Version="19.11.2" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ fi

cd "$script_dir"

dotnet test --no-build --logger 'console;verbosity=detailed' --framework 'netcoreapp3.1' ./RabbitMQDotNetClient.sln < /dev/null
dotnet test --no-build --logger 'console;verbosity=detailed' --framework 'net6.0' ./RabbitMQDotNetClient.sln < /dev/null