Skip to content

Commit

Permalink
Enabling .NET 9 tests for SF SDK packages (#390)
Browse files Browse the repository at this point in the history
Enabling tests for .NET 9 builds. 
Microsoft.ServiceFabric.Services.Remoting.Testing has been modified to be compatible with the now deprecated BinaryFormatter. 
The build script and build pipeline have been modified to mitigate the absence of .NET 9 SDK in the pipeline image. These changes will be reverted once full support for .NET 9 is available.
  • Loading branch information
plave0 authored Oct 9, 2024
1 parent 3605bfb commit 23277e0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ jobs:
TEST_RESULT_DIR: drop\testresults
steps:
- uses: actions/checkout@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Build Everything
shell: powershell
run: ./build.ps1
run: dotnet build buildAll.proj
- name: Run Tests
run: dotnet test code.sln --configuration release --nologo --settings test\unittests\default.runsettings --results-directory ${{ env.TEST_RESULT_DIR }} --logger trx
- name: upload artifacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ProjectGuid>{1BDC4681-FDBA-4E55-A247-5F779627A4D7}</ProjectGuid>
<AssemblyName>Microsoft.ServiceFabric.Actors.StateMigration.Tests</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ProjectGuid>{63B58D31-66BB-4879-B4F1-0969FA3F4464}</ProjectGuid>
<AssemblyName>Microsoft.ServiceFabric.Actors.Tests</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<ProjectGuid>{AE4034AC-27BC-43B8-9176-068B4794E25E}</ProjectGuid>
<AssemblyName>Microsoft.ServiceFabric.Services.Remoting.Tests</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
Expand All @@ -20,4 +21,9 @@
<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\netstandard\Microsoft.ServiceFabric.Services.Remoting\Microsoft.ServiceFabric.Services.Remoting_netstandard.csproj" />
</ItemGroup>
<ItemGroup>
<!-- BinaryFormatter compatibility package -->
<!-- The need for this package is documented in https://learn.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-migration-guide/compatibility-package-->
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="9.0.0-*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ProjectGuid>{ECB3825D-B309-4C76-A20D-76544459F611}</ProjectGuid>
<AssemblyName>Microsoft.ServiceFabric.Services.Tests</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
Expand Down

0 comments on commit 23277e0

Please sign in to comment.