Skip to content

Run tests using .NET 10 #3662

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
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 .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: 8.0.x
dotnet-version: 10.0.x

- name: Generate Async code
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/NetCoreTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
DB_INIT: |
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress mcr.microsoft.com/mssql/server:2019-latest;
- DB: SqlServer2008-MicrosoftDataSqlClientDriver
CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;"
CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;TrustServerCertificate=true;"
OS: ubuntu-latest
DB_INIT: |
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress mcr.microsoft.com/mssql/server:2019-latest;
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions ShowBuildMenu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ testSetupMenu() {
}

testRun(){
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f net8.0
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f net8.0
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f net10.0
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f net10.0
mainMenu
}

Expand Down
2 changes: 1 addition & 1 deletion Tools/BuildTool/BuildTool.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
</Project>
6 changes: 5 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ environment:
- DB: SqlServer2008
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;
- DB: SqlServer2008-MicrosoftDataSqlClientDriver
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;TrustServerCertificate=true;
- DB: Firebird
- DB: Firebird4
- DB: MySQL
CONNECTION_STRING: Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;SslMode=none;CharSet=utf8;
init:
# Required for having windows endlines in sources zip
- git config --global core.autocrlf true
- ps: |
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1"
& $env:temp\dotnet-install.ps1 -Channel 10.0 -Quality preview -InstallDir "$env:ProgramFiles\dotnet"

build: off
before_test:
- ps: |-
Expand Down
5 changes: 3 additions & 2 deletions build-common/NHibernate.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<FileVersion Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionPrefix).$(BuildNumber)</FileVersion>
<FileVersion Condition="'$(FileVersion)' == ''">$(VersionPrefix).0</FileVersion>

<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net48;net8.0</NhAppTargetFrameworks>
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;net48;netcoreapp2.0;netstandard2.0;netstandard2.1;net6.0;net8.0</NhLibTargetFrameworks>
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net48;net10.0</NhAppTargetFrameworks>
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;net48;netcoreapp2.0;netstandard2.0;netstandard2.1;net6.0;net8.0;net10.0</NhLibTargetFrameworks>
<RuntimeFrameworkVersion Condition="'$(TargetFramework)' == 'netcoreapp2.0'">2.0.3</RuntimeFrameworkVersion>
<NhNetFx>false</NhNetFx>
<NhNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</NhNetFx>
Expand All @@ -25,6 +25,7 @@
<NoWarn>$(NoWarn);NU1903</NoWarn>
<NoWarn Condition="'$(TargetFramework)' == 'net6.0'">$(NoWarn);SYSLIB0011</NoWarn>
<NoWarn Condition="'$(TargetFramework)' == 'net8.0'">$(NoWarn);SYSLIB0011;SYSLIB0050;SYSLIB0051</NoWarn>
<NoWarn Condition="'$(TargetFramework)' == 'net10.0'">$(NoWarn);SYSLIB0011;SYSLIB0050;SYSLIB0051</NoWarn>

<Product>NHibernate</Product>
<Company>NHibernate.info</Company>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "10.0.100-preview.7.25380.108",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Task Test -depends Build {
'NHibernate.Test',
'NHibernate.Test.VisualBasic'
) | ForEach-Object {
$assembly = [IO.Path]::Combine("src", $_, "bin", "Release", "net8.0", "$_.dll")
$assembly = [IO.Path]::Combine("src", $_, "bin", "Release", "net10.0", "$_.dll")
Exec {
dotnet $assembly --labels=before --nocolor "--result=$_-TestResult.xml"
}
Expand Down
2 changes: 1 addition & 1 deletion src/AsyncGenerator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
scanForMissingAsyncMembers:
- all: true
- filePath: NHibernate.Test/NHibernate.Test.csproj
targetFramework: net8.0
targetFramework: net10.0
concurrentRun: true
applyChanges: true
suppressDiagnosticFailures:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<OptionExplicit>On</OptionExplicit>
<OptionStrict>On</OptionStrict>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
<ItemGroup>
<None Remove="**\*.hbm.xml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net10.0'">
<Compile Remove="**\Issues\NH3302\**" />
</ItemGroup>
<ItemGroup>
Expand All @@ -25,12 +25,11 @@
<None Include="..\NHibernate.Test\App.config" Link="App.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="NUnitLite" Version="3.14.0" />
</ItemGroup>
<ItemGroup>
Expand Down
18 changes: 8 additions & 10 deletions src/NHibernate.Test/NHibernate.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
<NoWarn>$(NoWarn);3001;3002;3003;3005;8981;SYSLIB0003;SYSLIB0012</NoWarn>
<ContentSQLiteInteropFiles>true</ContentSQLiteInteropFiles>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\NHibernate.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
Expand Down Expand Up @@ -43,7 +41,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net10.0'">
<Compile Remove="**\CfgTest\DefaultNsAssmFixture.cs" />
<Compile Remove="**\CfgTest\HbmOrderingFixture.cs" />
<Compile Remove="**\DynamicProxyTests\PeVerifyFixture.cs" />
Expand All @@ -56,7 +54,7 @@
<ItemGroup>
<PackageReference Include="log4net" Version="3.0.2" />
<PackageReference Include="Microsoft.AspNetCore.OData" Version="7.7.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="3.1.5" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.6" />
<PackageReference Include="NHibernate.Caches.CoreDistributedCache.Memory" Version="5.9.0" />
<PackageReference Include="NHibernate.Caches.Util.JsonSerializer" Version="5.9.0" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.117" />
Expand All @@ -65,7 +63,7 @@
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="9.1.1" />
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="MySql.Data" Version="8.0.30" />
Expand All @@ -79,16 +77,16 @@
<PackageReference Include="Microsoft.SqlServer.Compact" Version="4.0.8876.1" />
<PackageReference Include="Oracle.ManagedDataAccess" Version="21.14.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<ItemGroup Condition="'$(TargetFramework)'=='net10.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="10.0.0-preview.7.25380.108" />
<PackageReference Include="System.CodeDom" Version="4.7.0" />
<PackageReference Include="System.Data.Odbc" Version="4.7.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="System.Data.OracleClient" Version="1.0.8">
<ExcludeAssets>compile</ExcludeAssets>
</PackageReference>
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="9.0.8" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.140" />
<PackageReference Include="System.Data.Odbc" Version="4.7.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="NUnitLite" Version="3.14.0" />
</ItemGroup>
<ItemGroup Condition=" '$(NuGetPackageRoot)' != '' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
Expand All @@ -18,7 +18,7 @@
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="NUnitLite" Version="3.14.0" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/NHibernate/NHibernate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.0-preview.7.25380.108" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions teamcity.build
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<target name="setup-teamcity-sqlServer-MicrosoftDataSqlClientDriver">
<property name="db-service" value="MSSQL$SQLEXPRESS" />
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.MicrosoftDataSqlClientDriver" />
<property name="nhibernate.connection.connection_string" value="Server=(local);initial catalog=nhibernate;Integrated Security=SSPI;TrustServerCertificate=true;" />
</target>

<target name="setup-teamcity-sqlServer2012">
Expand Down
Loading