Skip to content

Commit

Permalink
Run tests using .NET 8.0 (#155)
Browse files Browse the repository at this point in the history
* Set EnableUnsafeBinaryFormatterSerialization to true
  • Loading branch information
hazzik authored May 24, 2024
1 parent e112150 commit 629f070
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/GenerateAsyncCode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Generate Async code
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<PropertyGroup>
<Product>NHibernate.Caches.CoreDistributedCache</Product>
<Description>Unit tests of cache provider for NHibernate using .Net Core IDistributedCache (Microsoft.Extensions.Caching.Abstractions).</Description>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net461;net8.0</TargetFrameworks>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
Expand All @@ -28,7 +29,7 @@
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="NUnitLite" Version="3.14.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<PropertyGroup>
<Product>NHibernate.Caches.CoreMemoryCache</Product>
<Description>Unit tests of cache provider for NHibernate using .Net Core MemoryCache (Microsoft.Extensions.Caching.Memory).</Description>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net461;net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
Expand All @@ -22,7 +22,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="NUnitLite" Version="3.14.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<PropertyGroup>
<Product>NHibernate.Caches.Common.Tests</Product>
<Description>Unit tests base for cache providers.</Description>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net461;net8.0</TargetFrameworks>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
Expand All @@ -20,7 +21,7 @@
<PackageReference Include="NHibernate" Version="5.2.0" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="NUnitLite" Version="3.14.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<PropertyGroup>
<Product>NHibernate.Caches.RtMemoryCache</Product>
<Description>Unit tests of cache provider for NHibernate using MemoryCache.</Description>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net461;net8.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
Expand All @@ -26,7 +26,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="NUnitLite" Version="3.14.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
<PropertyGroup>
<Product>NHibernate.Caches.StackExchangeRedis.Tests</Product>
<Description>Unit tests of cache provider NHibernate using StackExchange.Redis.</Description>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net461;net8.0</TargetFrameworks>
<ImplicitlyExpandNETStandardFacades>false</ImplicitlyExpandNETStandardFacades>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
Expand All @@ -24,7 +25,7 @@
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="NUnitLite" Version="3.14.0" />
<PackageReference Include="System.Runtime.Caching" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<PropertyGroup>
<Product>NHibernate.Caches.Util.JsonSerializer.Tests</Product>
<Description>Unit tests for json serializer.</Description>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net461;net8.0</TargetFrameworks>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
Expand All @@ -21,7 +22,7 @@
<PackageReference Include="log4net" Version="2.0.17" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="NUnitLite" Version="3.14.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ configuration:
environment:
global:
netTargetFx: net461
coreTargetFx: net6.0
coreTargetFx: net8.0
matrix:
- tests: net
- tests: core
Expand Down
2 changes: 1 addition & 1 deletion buildcommon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<property name="key.file" value="../NHibernate.Caches.snk" />

<property name="net.target-fx" value="net461" />
<property name="net.core-fx" value="net6.0" />
<property name="net.core-fx" value="net8.0" />

<property name="nant-version.current" value="${assemblyname::get-version(assembly::get-name(nant::get-assembly()))}" />
<property name="nant-version.required" value="0.85.2478.0" />
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestFeature"
}
}

0 comments on commit 629f070

Please sign in to comment.