Skip to content

Commit 0b8b34b

Browse files
committed
chore: Run test projects sequentially
1 parent 1cc56ea commit 0b8b34b

File tree

3 files changed

+18
-23
lines changed

3 files changed

+18
-23
lines changed

.github/workflows/cicd.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,6 @@ jobs:
7878
- name: Run Tests
7979
run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }}
8080

81-
# The Test Reporter GH Action is not compatible with the recent
82-
# actions/upload-artifact@v4 updates: https://github.com/dorny/test-reporter/issues/363.
83-
- name: Upload Test And Coverage Results
84-
uses: actions/upload-artifact@v3
85-
if: always()
86-
with:
87-
name: ${{ matrix.os }}-v3
88-
path: test-results
89-
9081
- name: Upload Test And Coverage Results
9182
uses: actions/upload-artifact@v4
9283
if: always()

.github/workflows/test-report.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ jobs:
2121
contents: read
2222

2323
steps:
24+
# https://github.com/dorny/test-reporter/issues/363#issuecomment-2381625959.
2425
- name: Publish Test Report
25-
uses: dorny/test-reporter@v1.8.0
26+
uses: dorny/test-reporter@v1.9.1
2627
with:
27-
artifact: ${{ matrix.os }}-v3
28+
artifact: ${{ matrix.os }}
2829
name: report (${{ matrix.os }})
2930
path: '*.trx'
3031
reporter: dotnet-trx

build.cake

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#tool nuget:?package=dotnet-sonarscanner&version=7.1.1
1+
#tool nuget:?package=dotnet-sonarscanner&version=9.0.0
22

33
#addin nuget:?package=Cake.Sonar&version=1.1.32
44

@@ -74,18 +74,21 @@ Task("Build")
7474
Task("Tests")
7575
.Does(() =>
7676
{
77-
DotNetTest(param.Solution, new DotNetTestSettings
77+
foreach(var testProject in param.Projects.OnlyTests)
7878
{
79-
Configuration = param.Configuration,
80-
Verbosity = param.Verbosity,
81-
NoRestore = true,
82-
NoBuild = true,
83-
Collectors = new[] { "XPlat Code Coverage;Format=opencover" },
84-
Filter = param.TestFilter,
85-
ResultsDirectory = param.Paths.Directories.TestResultsDirectoryPath,
86-
ArgumentCustomization = args => args
87-
.AppendSwitchQuoted("--blame-hang-timeout", "5m")
88-
});
79+
DotNetTest(testProject.Path.FullPath, new DotNetTestSettings
80+
{
81+
Configuration = param.Configuration,
82+
Verbosity = param.Verbosity,
83+
NoRestore = true,
84+
NoBuild = true,
85+
Collectors = new[] { "XPlat Code Coverage;Format=opencover" },
86+
Filter = param.TestFilter,
87+
ResultsDirectory = param.Paths.Directories.TestResultsDirectoryPath,
88+
ArgumentCustomization = args => args
89+
.AppendSwitchQuoted("--blame-hang-timeout", "5m")
90+
});
91+
}
8992
});
9093

9194
Task("Sonar-Begin")

0 commit comments

Comments
 (0)