Skip to content

Commit 69f5ef0

Browse files
jhaygood86eXpl0it3r
authored andcommitted
Fix non-Windows CI test step for multiple *.Test.csproj matches
dotnet test's underlying MSBuild VSTest target only accepts a single project (MSB1008: Only one project can be specified), unlike dotnet build. The non-Windows test step passed the *.Test.csproj glob straight to dotnet test, which happened to work when only one project matched it, but now that HtmlRenderer.Test.csproj also matches, dotnet expands the glob to two paths and the step fails outright. Iterate and test each matching project individually instead.
1 parent bc7f351 commit 69f5ef0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ jobs:
6060

6161
- name: Run Tests
6262
if: runner.os != 'Windows'
63-
run: dotnet test Source/Test/**/*.Test.csproj --configuration Release --no-build --logger trx --results-directory ${{ github.workspace }}/TestResults
63+
run: |
64+
$failed = $false
65+
Get-ChildItem -Path Source/Test -Recurse -Filter *.Test.csproj | ForEach-Object {
66+
dotnet test $_.FullName --configuration Release --no-build --logger trx --results-directory ${{ github.workspace }}/TestResults
67+
if ($LASTEXITCODE -ne 0) { $failed = $true }
68+
}
69+
if ($failed) { exit 1 }
6470
env:
6571
PDF_OUTPUT_DIRECTORY: ${{ github.workspace }}/pdf-artifacts/${{ matrix.platform.name }}-${{ matrix.dotnet.name }}
6672

0 commit comments

Comments
 (0)