Skip to content
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

Update CI to enable net7.0 preview builds #1677

Merged
merged 5 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 8 additions & 1 deletion .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ jobs:
- name: Update SubModules
if: steps.filter.outputs.src == 'true'
run: git submodule update --init --recursive

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
7.0.x
6.0.x
5.0.x
include-prerelease: true
- name: Build with dotnet
run: "dotnet build AzureSignalR.sln /p:DisableNet461Tests=true"
if: steps.filter.outputs.src == 'true'
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ jobs:
- name: Update SubModules
run: git submodule update --init --recursive
if: steps.filter.outputs.src == 'true'
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
7.0.x
6.0.x
5.0.x
include-prerelease: true
- name: Build with dotnet
run: "dotnet build AzureSignalR.sln /p:DisableNet461Tests=true"
if: steps.filter.outputs.src == 'true'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ jobs:
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
7.0.x
6.0.x
5.0.x
include-prerelease: true

- name: Test
run: dotnet test
Expand Down
2 changes: 2 additions & 0 deletions build/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
<MicrosoftAspNetCoreHttpConnectionsClientPackage3_0Version>3.0.0</MicrosoftAspNetCoreHttpConnectionsClientPackage3_0Version>
<MicrosoftAspNetCoreHttpConnectionsClientPackage3_1Version>3.1.9</MicrosoftAspNetCoreHttpConnectionsClientPackage3_1Version>
<MicrosoftAspNetCoreHttpConnectionsClientPackage5_0Version>5.0.1</MicrosoftAspNetCoreHttpConnectionsClientPackage5_0Version>
<MicrosoftAspNetCoreHttpConnectionsClientPackage7_0Version>7.0.0-preview.7.22376.6</MicrosoftAspNetCoreHttpConnectionsClientPackage7_0Version>
<MicrosoftAspNetCoreHttpConnectionsCommonPackageVersion>1.0.4</MicrosoftAspNetCoreHttpConnectionsCommonPackageVersion>
<MicrosoftAspNetCoreHttpConnectionsCommonPackage3_0Version>3.0.0</MicrosoftAspNetCoreHttpConnectionsCommonPackage3_0Version>
<MicrosoftAspNetCoreHttpConnectionsCommonPackage3_1Version>3.1.9</MicrosoftAspNetCoreHttpConnectionsCommonPackage3_1Version>
<MicrosoftAspNetCoreHttpConnectionsCommonPackage5_0Version>5.0.1</MicrosoftAspNetCoreHttpConnectionsCommonPackage5_0Version>
<MicrosoftAspNetCoreHttpConnectionsCommonPackage7_0Version>7.0.0-preview.7.22376.6</MicrosoftAspNetCoreHttpConnectionsCommonPackage7_0Version>
<MicrosoftExtensionsLoggingAbstractionsPackageVersion>2.1.1</MicrosoftExtensionsLoggingAbstractionsPackageVersion>
<MicrosoftExtensionsLoggingAbstractionsPackage3_0Version>3.0.0</MicrosoftExtensionsLoggingAbstractionsPackage3_0Version>
<MicrosoftExtensionsLoggingAbstractionsPackage3_1Version>3.1.9</MicrosoftExtensionsLoggingAbstractionsPackage3_1Version>
Expand Down
6 changes: 5 additions & 1 deletion src/Microsoft.Azure.SignalR/Microsoft.Azure.SignalR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -31,6 +31,10 @@
</ItemGroup>
</Target>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Http.Connections.Client" Version="$(MicrosoftAspNetCoreHttpConnectionsClientPackage7_0Version)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Http.Connections.Client" Version="$(MicrosoftAspNetCoreHttpConnectionsClientPackage5_0Version)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
JialinXin marked this conversation as resolved.
Show resolved Hide resolved
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DefineConstants>MULTIFRAMEWORK</DefineConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,8 @@ public async Task TestEndpointManagerWithAddEndpointsWithServersTag()
var serversTag = "Server1;Server2;Server3";
await Task.WhenAll(containers.Select(c => c.MockReceivedServersPing(serversTag)));

// wait one interval+ for Ready state and check negotiation is added.
await Task.Delay(6000);
await hubEndpoints[1].ScaleTask;
JialinXin marked this conversation as resolved.
Show resolved Hide resolved
await Task.Delay(100);

ngoEps = sem.GetEndpoints("hub").OrderBy(x => x.Name).ToArray();
Assert.Equal(2, ngoEps.Length);
Expand Down Expand Up @@ -1162,7 +1162,8 @@ public async Task TestEndpointManagerWithRemovedEndpointsWithClients()

// Mock client now drops and able to remove endpoints
await Task.WhenAll(containers.Select(x => x.MockReceivedStatusPing(false)));
await Task.Delay(6000);
await hubEndpoints[1].ScaleTask;
await Task.Delay(100);

// validate container side updated
hubEndpoints = container.GetOnlineEndpoints().ToArray();
Expand Down Expand Up @@ -1242,7 +1243,8 @@ public async Task TestEndpointManagerWithMultiHubsWithEndpointTypeUpdate()
await Task.WhenAll(containers.Select(x => x.MockReceivedServersPing("aaa;bbb")));
containers1 = container1.GetTestOnlineContainers();
await Task.WhenAll(containers1.Select(x => x.MockReceivedServersPing("aaa;bbb")));
await Task.Delay(6000);
await hubEndpoints.Single(x => x.Name == "22" && x.EndpointType == EndpointType.Primary).ScaleTask;
await Task.Delay(100);

ngoEps = sem.GetEndpoints("hub").OrderBy(x => x.Name).ToArray();
Assert.Equal(2, ngoEps.Length);
Expand All @@ -1255,7 +1257,8 @@ public async Task TestEndpointManagerWithMultiHubsWithEndpointTypeUpdate()
await Task.WhenAll(containers.Select(x => x.MockReceivedStatusPing(false)));
containers1 = container1.GetTestOnlineContainers();
await Task.WhenAll(containers1.Select(x => x.MockReceivedStatusPing(false)));
await Task.Delay(6000);
await hubEndpoints.Single(x => x.Name == "22" && x.EndpointType == EndpointType.Secondary).ScaleTask;
await Task.Delay(100);

// validate container updated as well
hubEndpoints = container.GetOnlineEndpoints().OrderBy(x => x.Name).ToArray();
Expand Down Expand Up @@ -1347,7 +1350,8 @@ public async Task TestEndpointManagerWithMultiHubsWithServerEndpointUpdate()
await Task.WhenAll(containers.Select(x => x.MockReceivedServersPing("aaa;bbb")));
containers1 = container1.GetTestOnlineContainers();
await Task.WhenAll(containers1.Select(x => x.MockReceivedServersPing("aaa;bbb")));
await Task.Delay(6000);
await hubEndpoints.Single(x => x.Name == "1" && x.ServerEndpoint.AbsoluteUri == testSe).ScaleTask;
await Task.Delay(100);
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

ngoEps = sem.GetEndpoints("hub").OrderBy(x => x.Name).ToArray();
Assert.Equal(2, ngoEps.Length);
Expand All @@ -1359,7 +1363,8 @@ public async Task TestEndpointManagerWithMultiHubsWithServerEndpointUpdate()
await Task.WhenAll(containers.Select(x => x.MockReceivedStatusPing(false)));
containers1 = container1.GetTestOnlineContainers();
await Task.WhenAll(containers1.Select(x => x.MockReceivedStatusPing(false)));
await Task.Delay(6000);
await hubEndpoints.Single(x => x.Name == "1" && x.ServerEndpoint.AbsoluteUri == Url1).ScaleTask;
await Task.Delay(100);

// validate container updated as well
hubEndpoints = container.GetOnlineEndpoints().OrderBy(x => x.Name).ToArray();
Expand Down Expand Up @@ -1424,8 +1429,8 @@ public async Task TestEndpointManagerWithReloadMultipleTimes()
var serversTag = "Server1;Server2;Server3";
await Task.WhenAll(containers.Select(c => c.MockReceivedServersPing(serversTag)));

// wait one interval+ for Ready state and check negotiation is added.
await Task.Delay(6000);
await hubEndpoints[1].ScaleTask;
await Task.Delay(100);

ngoEps = sem.GetEndpoints("hub").OrderBy(x => x.Name).ToArray();
Assert.Equal(2, ngoEps.Length);
Expand All @@ -1449,7 +1454,7 @@ public async Task TestEndpointManagerWithReloadMultipleTimes()
_ = sem.TestReloadServiceEndpoints(newEndpoints, 10);

// validate container side not updated
hubEndpoints = container.GetOnlineEndpoints().ToArray();
hubEndpoints = container.GetOnlineEndpoints().OrderBy(x => x.Name).ToArray();
Assert.Equal(2, hubEndpoints.Length);
Assert.Equal("1", hubEndpoints[0].Name);

Expand All @@ -1460,7 +1465,8 @@ public async Task TestEndpointManagerWithReloadMultipleTimes()

// Mock client now drops and able to remove endpoints
await Task.WhenAll(containers.Select(x => x.MockReceivedStatusPing(false)));
await Task.Delay(6000);
await hubEndpoints[0].ScaleTask;
await Task.Delay(100);

// validate container side updated
hubEndpoints = container.GetOnlineEndpoints().ToArray();
Expand Down
4 changes: 4 additions & 0 deletions test/Microsoft.Azure.SignalR.Tests/NegotiateHandlerFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,10 @@ public async Task TestNegotiateHandlerWithMultipleEndpointsAndCustomRouter()
};

var responseFeature = new HttpResponseFeature();
var responseBodyFeature = new StreamResponseBodyFeature(responseFeature.Body);
features.Set<IHttpRequestFeature>(requestFeature);
features.Set<IHttpResponseFeature>(responseFeature);
features.Set<IHttpResponseBodyFeature>(responseBodyFeature);
httpContext = new DefaultHttpContext(features);

handler = serviceProvider.GetRequiredService<NegotiateHandler<Chat>>();
Expand All @@ -419,8 +421,10 @@ public async Task TestNegotiateHandlerWithMultipleEndpointsAndCustomRouter()
};

responseFeature = new HttpResponseFeature();
responseBodyFeature = new StreamResponseBodyFeature(responseFeature.Body);
features.Set<IHttpRequestFeature>(requestFeature);
features.Set<IHttpResponseFeature>(responseFeature);
features.Set<IHttpResponseBodyFeature>(responseBodyFeature);
httpContext = new DefaultHttpContext(features);

handler = serviceProvider.GetRequiredService<NegotiateHandler<Chat>>();
Expand Down