Skip to content

Commit ecfa478

Browse files
authored
Run tests on .NET 6 (#2951)
1 parent 6576a96 commit ecfa478

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+121
-1632
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"isRoot": true,
44
"tools": {
55
"csharpasyncgenerator.tool": {
6-
"version": "0.19.1",
6+
"version": "0.20.1",
77
"commands": [
88
"async-generator"
99
]
1010
}
1111
}
12-
}
12+
}

.github/workflows/NetCoreTests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ jobs:
5454
5555
- uses: actions/checkout@v2
5656
- name: Setup .NET
57-
uses: actions/setup-dotnet@v1.8.0
57+
uses: actions/setup-dotnet@v1
5858
with:
59-
dotnet-version: 2.1.x
59+
dotnet-version: 6.0.x
6060

6161
- name: Build and Test
6262
run: |

ShowBuildMenu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ testSetupMenu() {
172172
}
173173

174174
testRun(){
175-
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f netcoreapp2.0
176-
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f netcoreapp2.0
175+
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f net6.0
176+
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f net6.0
177177
mainMenu
178178
}
179179

Tools/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ csharpasyncgenerator.commandline/
44
gitreleasemanager/
55
obj/
66
microsoft.*
7+
netstandard.*

Tools/BuildTool/BuildTool.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66
</Project>

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: '{build}'
2-
image: Visual Studio 2017
2+
image: Visual Studio 2022
33
environment:
44
matrix:
55
- DB: SqlServer2008
@@ -8,7 +8,7 @@ environment:
88
CONNECTION_STRING: Host=localhost;Port=5432;Username=postgres;Password=Password12!;Database=nhibernate;Enlist=true;
99
- DB: Firebird
1010
- DB: MySQL
11-
CONNECTION_STRING: Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;SslMode=none;
11+
CONNECTION_STRING: Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;SslMode=none;CharSet=utf8;
1212
- DB: SQLite
1313
init:
1414
# Required for having windows endlines in sources zip
@@ -42,7 +42,7 @@ before_test:
4242
Start-Service 'MySQL57'
4343
# Create nhibernate database (not handled by NHibernate.TestDatabaseSetup.dll)
4444
$env:MYSQL_PWD = 'Password12!'
45-
& 'C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql' -e 'CREATE DATABASE nhibernate;' --user=root
45+
& 'C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql' -e 'CREATE DATABASE nhibernate CHARACTER SET utf8 COLLATE utf8_general_ci;' --user=root
4646
}
4747
'Odbc' { Start-Service 'MSSQL$SQL2017' }
4848
'PostgreSQL' {

build-common/NHibernate.props

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,26 @@
1313
<FileVersion Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionPrefix).$(BuildNumber)</FileVersion>
1414
<FileVersion Condition="'$(FileVersion)' == ''">$(VersionPrefix).0</FileVersion>
1515

16-
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net461;netcoreapp2.0</NhAppTargetFrameworks>
16+
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net461;net6.0</NhAppTargetFrameworks>
1717
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;netcoreapp2.0;netstandard2.0</NhLibTargetFrameworks>
1818
<NhNetFx>false</NhNetFx>
1919
<NhNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</NhNetFx>
20-
<DefineConstants Condition="$(NhNetFx) AND $(NhVbNet) == ''" >NETFX;$(DefineConstants)</DefineConstants>
20+
<!-- Visual Basic requires to use coma (,) as a separator, other project types - semicolon (;) -->
21+
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' != '.vbproj'">NETFX;$(DefineConstants)</DefineConstants>
22+
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' == '.vbproj'">NETFX,$(DefineConstants)</DefineConstants>
2123

2224
<Product>NHibernate</Product>
2325
<Company>NHibernate.info</Company>
2426
<Copyright>Licensed under LGPL.</Copyright>
2527
<Authors>NHibernate community, Hibernate community</Authors>
2628
<NeutralLanguage>en-US</NeutralLanguage>
2729

30+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
31+
<TreatSpecificWarningsAsErrors />
32+
33+
<DisableImplicitPackageTargetFallback>True</DisableImplicitPackageTargetFallback>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(IsPackable)' == 'True'">
2836
<PackageProjectUrl>https://nhibernate.info</PackageProjectUrl>
2937
<PackageIconUrl>https://raw.githubusercontent.com/nhibernate/nhibernate-core/master/logo/NHibernate-NuGet.png</PackageIconUrl>
3038
<PackageIcon>NHibernate-NuGet.png</PackageIcon>
@@ -35,11 +43,6 @@
3543
<PublishRepositoryUrl>true</PublishRepositoryUrl>
3644
<IncludeSymbols>true</IncludeSymbols>
3745
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
38-
39-
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
40-
<TreatSpecificWarningsAsErrors />
41-
42-
<DisableImplicitPackageTargetFallback>True</DisableImplicitPackageTargetFallback>
4346
</PropertyGroup>
4447
<ItemGroup>
4548
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "6.0.101",
4+
"rollForward": "latestFeature"
5+
}
6+
}

psake.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Task Test -depends Build {
113113
'NHibernate.Test',
114114
'NHibernate.Test.VisualBasic'
115115
) | ForEach-Object {
116-
$assembly = [IO.Path]::Combine("src", $_, "bin", "Release", "netcoreapp2.0", "$_.dll")
116+
$assembly = [IO.Path]::Combine("src", $_, "bin", "Release", "net6.0", "$_.dll")
117117
Exec {
118118
dotnet $assembly --labels=before --nocolor "--result=$_-TestResult.xml"
119119
}

src/AsyncGenerator.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
scanForMissingAsyncMembers:
188188
- all: true
189189
- filePath: NHibernate.Test/NHibernate.Test.csproj
190-
targetFramework: netcoreapp2.0
190+
targetFramework: net6.0
191191
concurrentRun: true
192192
applyChanges: true
193193
suppressDiagnosticFailures:
@@ -230,6 +230,15 @@
230230
- filePathEndsWith: Linq/MathTests.cs
231231
- filePathEndsWith: Linq/ExpressionSessionLeakTest.cs
232232
- filePathEndsWith: Linq/NorthwindDbCreator.cs
233+
ignoreSearchForAsyncCounterparts:
234+
- name: Wait
235+
containingTypeName: Task
236+
- name: Prepare
237+
containingTypeName: DbCommand
238+
- name: Close
239+
containingTypeName: DbConnection
240+
- name: Close
241+
containingTypeName: DbDataReader
233242
cancellationTokens:
234243
enabled: true
235244
scanMethodBody: true

0 commit comments

Comments
 (0)