Skip to content

Commit fd8d012

Browse files
Migrate xUnit v3 with Microsoft Testing Platform v2 (#18590)
* Initial plan * Migrate xUnit v3 with Microsoft Testing Platform v2 and update workflow CLI syntax Co-authored-by: sebastienros <[email protected]> * Remove xunit.runner.visualstudio package (no longer needed with MTP v2) Co-authored-by: sebastienros <[email protected]> * Remove analyzers library --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: sebastienros <[email protected]> Co-authored-by: Sébastien Ros <[email protected]>
1 parent de1187d commit fd8d012

File tree

9 files changed

+11
-16
lines changed

9 files changed

+11
-16
lines changed

.github/workflows/mac_unit_test_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
- name: Build and test
1616
run: |
1717
dotnet build -c Release /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true
18-
dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
18+
dotnet test --project ./test/OrchardCore.Tests/OrchardCore.Tests.csproj -c Release --no-restore --no-build

.github/workflows/main_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
dotnet build -c Release /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true /p:NuGetAudit=false
3636
- name: Unit Tests
3737
run: |
38-
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
38+
dotnet test --project ./test/OrchardCore.Tests/OrchardCore.Tests.csproj -c Release --no-build
3939
- name: Functional Tests
4040
if: matrix.os == 'ubuntu-24.04'
4141
run: |

.github/workflows/pr_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
dotnet build -c Release /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true /p:NuGetAudit=false
3333
- name: Unit Tests
3434
run: |
35-
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
35+
dotnet test --project ./test/OrchardCore.Tests/OrchardCore.Tests.csproj -c Release --no-build
3636
- name: Functional Tests
3737
if: matrix.os == 'ubuntu-24.04'
3838
run: |

.github/workflows/preview_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Unit Tests
4242
if: steps.check-publish.outputs.should-publish == 'true'
4343
run: |
44-
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
44+
dotnet test --project ./test/OrchardCore.Tests/OrchardCore.Tests.csproj -c Release --no-build
4545
- name: Functional Tests
4646
if: steps.check-publish.outputs.should-publish == 'true'
4747
run: |

.github/workflows/release_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
dotnet build -c Release /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true -p:Version=${{ steps.get_version.outputs.VERSION }}
4646
- name: Unit Tests
4747
run: |
48-
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
48+
dotnet test --project ./test/OrchardCore.Tests/OrchardCore.Tests.csproj -c Release --no-build
4949
- name: Functional Tests
5050
if: matrix.os == 'ubuntu-24.04'
5151
run: |

Directory.Packages.props

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@
6161
<PackageVersion Include="SixLabors.ImageSharp.Web.Providers.AWS" Version="3.2.0" />
6262
<PackageVersion Include="StackExchange.Redis" Version="2.10.1" />
6363
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118" />
64-
<PackageVersion Include="xunit.v3" Version="3.2.1" />
65-
<PackageVersion Include="xunit.analyzers" Version="1.26.0" />
66-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
64+
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.1" />
6765
<PackageVersion Include="YesSql" Version="5.4.7" />
6866
<PackageVersion Include="YesSql.Abstractions" Version="5.4.7" />
6967
<PackageVersion Include="YesSql.Core" Version="5.4.7" />

global.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"sdk": {
44
"version": "10.0.100",
55
"rollForward": "latestMajor"
6+
},
7+
"test": {
8+
"runner": "Microsoft.Testing.Platform"
69
}
710
}
811

test/OrchardCore.Abstractions.Tests/OrchardCore.Abstractions.Tests.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616
<PackageReference Include="AngleSharp" />
1717
<PackageReference Include="Lorem.Universal.NET" />
1818
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" />
2019
<PackageReference Include="Moq" />
21-
<PackageReference Include="xunit.v3" />
22-
<PackageReference Include="xunit.analyzers" />
23-
<PackageReference Include="xunit.runner.visualstudio" />
20+
<PackageReference Include="xunit.v3.mtp-v2" />
2421
</ItemGroup>
2522

2623
<ItemGroup>

test/OrchardCore.Tests/OrchardCore.Tests.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,8 @@
6767
<ItemGroup>
6868
<PackageReference Include="AngleSharp" />
6969
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
70-
<PackageReference Include="Microsoft.NET.Test.Sdk" />
7170
<PackageReference Include="Moq" />
72-
<PackageReference Include="xunit.v3" />
73-
<PackageReference Include="xunit.analyzers" />
74-
<PackageReference Include="xunit.runner.visualstudio" />
71+
<PackageReference Include="xunit.v3.mtp-v2" />
7572
</ItemGroup>
7673

7774
<ItemGroup>

0 commit comments

Comments
 (0)