Skip to content

Commit

Permalink
chore: Run test projects sequentially
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed Oct 1, 2024
1 parent 1cc56ea commit 0b8b34b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 23 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ jobs:
- name: Run Tests
run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }}

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

- name: Upload Test And Coverage Results
uses: actions/upload-artifact@v4
if: always()
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ jobs:
contents: read

steps:
# https://github.com/dorny/test-reporter/issues/363#issuecomment-2381625959.
- name: Publish Test Report
uses: dorny/test-reporter@v1.8.0
uses: dorny/test-reporter@v1.9.1
with:
artifact: ${{ matrix.os }}-v3
artifact: ${{ matrix.os }}
name: report (${{ matrix.os }})
path: '*.trx'
reporter: dotnet-trx
27 changes: 15 additions & 12 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#tool nuget:?package=dotnet-sonarscanner&version=7.1.1
#tool nuget:?package=dotnet-sonarscanner&version=9.0.0

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

Expand Down Expand Up @@ -74,18 +74,21 @@ Task("Build")
Task("Tests")
.Does(() =>
{
DotNetTest(param.Solution, new DotNetTestSettings
foreach(var testProject in param.Projects.OnlyTests)
{
Configuration = param.Configuration,
Verbosity = param.Verbosity,
NoRestore = true,
NoBuild = true,
Collectors = new[] { "XPlat Code Coverage;Format=opencover" },
Filter = param.TestFilter,
ResultsDirectory = param.Paths.Directories.TestResultsDirectoryPath,
ArgumentCustomization = args => args
.AppendSwitchQuoted("--blame-hang-timeout", "5m")
});
DotNetTest(testProject.Path.FullPath, new DotNetTestSettings
{
Configuration = param.Configuration,
Verbosity = param.Verbosity,
NoRestore = true,
NoBuild = true,
Collectors = new[] { "XPlat Code Coverage;Format=opencover" },
Filter = param.TestFilter,
ResultsDirectory = param.Paths.Directories.TestResultsDirectoryPath,
ArgumentCustomization = args => args
.AppendSwitchQuoted("--blame-hang-timeout", "5m")
});
}
});

Task("Sonar-Begin")
Expand Down

0 comments on commit 0b8b34b

Please sign in to comment.