File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,12 @@ jobs:
4848 run : dotnet tool restore
4949
5050 - name : Build
51+ # Uses 'dotnet pwsh' because the default shell (bash/cmd) is not PowerShell
5152 run : dotnet pwsh ./build.ps1 -Build -Configuration ${{ env.CONFIGURATION }}
5253
5354 - name : Pack (Windows only)
5455 if : runner.os == 'Windows'
56+ # Uses 'shell: pwsh' so commands run in PowerShell context
5557 shell : pwsh
5658 run : |
5759 $commitTimestamp = git log -1 --format=%cI
9395 ForEach-Object { dotnet sourcelink test $_; if ($LASTEXITCODE) { throw "SourceLink test failed for $_" } }
9496
9597 - name : Test
98+ # Uses 'dotnet pwsh' because the default shell (bash/cmd) is not PowerShell
9699 run : dotnet pwsh ./build.ps1 -Test -NoBuild -Configuration ${{ env.CONFIGURATION }}
97100
98101 - name : Integration Tests (Windows)
Original file line number Diff line number Diff line change 9191 Write-Host " dotnet $ ( $Arguments -join ' ' ) " - ForegroundColor Cyan
9292 & dotnet @Arguments
9393 if ($LASTEXITCODE -ne 0 ) {
94- # On non-Windows platforms , net47 tests may fail due to missing mono,
95- # but this is expected. For test commands, we allow exit code 1 .
94+ # Some test frameworks (e.g. , net47) may not run on all platforms (Linux/macOS require mono).
95+ # Allow exit code 1 for test commands when the runnable tests passed but some frameworks couldn't execute .
9696 if ($AllowTestFailures -and $LASTEXITCODE -eq 1 ) {
9797 Write-Host " Test command returned exit code 1 (this may be due to net47 requiring mono on Linux)" - ForegroundColor Yellow
9898 } else {
@@ -115,6 +115,8 @@ try {
115115 }
116116
117117 Write-Host " `n === Running Tests ===" - ForegroundColor Green
118+ # AllowTestFailures handles the case where net47 tests cannot run (requires mono on Linux/macOS)
119+ # while still ensuring that tests that can run actually pass
118120 Invoke-DotNet ' test' , ' --no-build' , ' --configuration' , $Configuration - AllowTestFailures
119121
120122 # Note: Roslyn 4.4 analyzer is validated through integration tests
You can’t perform that action at this time.
0 commit comments