Skip to content

Commit 5d2a853

Browse files
committed
fix: force all tests to use new parallel xunit algorithm
https://xunit.net/docs/running-tests-in-parallel#algorithms
1 parent d3b0242 commit 5d2a853

File tree

10 files changed

+36
-11
lines changed

10 files changed

+36
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
9.0.x
138138
139139
- name: 🧪 Run unit tests
140-
run: dotnet test -c release -p:VSTestUseMSBuildOutput=false
140+
run: dotnet test -c release -p:VSTestUseMSBuildOutput=false --logger "console;verbosity=normal"
141141

142142
- name: 📛 Upload hang- and crash-dumps on test failure
143143
if: failure()

NuGet.Config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear/>
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
6+
</packageSources>
7+
</configuration>

bunit.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".items", ".items", "{A5D7B6
99
.gitattributes = .gitattributes
1010
.gitignore = .gitignore
1111
Directory.Build.props = Directory.Build.props
12+
Directory.Packages.props = Directory.Packages.props
1213
.config\dotnet-tools.json = .config\dotnet-tools.json
1314
global.json = global.json
1415
version.json = version.json
15-
Directory.Packages.props = Directory.Packages.props
1616
EndProjectSection
1717
EndProject
1818
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9A2B3B34-D41C-43E8-BC7D-246BEBE48D59}"
@@ -26,6 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{6EA09ED4
2626
tests\.editorconfig = tests\.editorconfig
2727
tests\Directory.Build.props = tests\Directory.Build.props
2828
tests\run-tests.ps1 = tests\run-tests.ps1
29+
tests\xunit.runner.json = tests\xunit.runner.json
2930
EndProjectSection
3031
EndProject
3132
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".text", ".text", "{392FCD4E-356A-412A-A854-8EE197EA65B9}"

tests/bunit.core.tests/bunit.core.tests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@
1111
<ProjectReference Include="..\..\src\bunit.web\bunit.web.csproj" />
1212
<ProjectReference Include="..\bunit.testassets\bunit.testassets.csproj" />
1313
</ItemGroup>
14+
15+
<ItemGroup>
16+
<Content Include="../xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
17+
</ItemGroup>
18+
1419
</Project>

tests/bunit.core.tests/xunit.runner.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/bunit.generators.tests/bunit.generators.tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@
3030
<ProjectReference Include="..\..\src\bunit.web\bunit.web.csproj" />
3131
</ItemGroup>
3232

33+
<ItemGroup>
34+
<Content Include="../xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
35+
</ItemGroup>
36+
3337
</Project>

tests/bunit.web.query.tests/bunit.web.query.tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@
1313
<ProjectReference Include="..\bunit.testassets\bunit.testassets.csproj" />
1414
</ItemGroup>
1515

16+
<ItemGroup>
17+
<Content Include="../xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
18+
</ItemGroup>
19+
1620
</Project>

tests/bunit.web.tests/bunit.web.tests.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@
1111
<ProjectReference Include="..\..\src\bunit.web\bunit.web.csproj" />
1212
<ProjectReference Include="..\bunit.testassets\bunit.testassets.csproj" />
1313
</ItemGroup>
14-
14+
15+
<ItemGroup>
16+
<Content Include="../xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
17+
</ItemGroup>
18+
1519
</Project>

tests/bunit.web.tests/xunit.runner.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/xunit.runner.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
3+
"diagnosticMessages": false,
4+
"methodDisplayOptions": "all",
5+
"parallelAlgorithm": "conservative",
6+
"maxParallelThreads": "2x",
7+
"parallelizeTestCollections": true
8+
}

0 commit comments

Comments
 (0)