Skip to content

Commit 2788ced

Browse files
Copilotatifaziz
andcommitted
Remove obvious comments and unnecessary AllowTestFailures logic
Co-authored-by: atifaziz <20511+atifaziz@users.noreply.github.com>
1 parent d686d4a commit 2788ced

2 files changed

Lines changed: 3 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ jobs:
4848
run: dotnet tool restore
4949

5050
- name: Build
51-
# Uses 'dotnet pwsh' because the default shell (bash/cmd) is not PowerShell
5251
run: dotnet pwsh ./build.ps1 -Build -Configuration ${{ env.CONFIGURATION }}
5352

5453
- name: Pack (Windows only)
5554
if: runner.os == 'Windows'
56-
# Uses 'shell: pwsh' so commands run in PowerShell context
5755
shell: pwsh
5856
run: |
5957
$commitTimestamp = git log -1 --format=%cI
@@ -95,7 +93,6 @@ jobs:
9593
ForEach-Object { dotnet sourcelink test $_; if ($LASTEXITCODE) { throw "SourceLink test failed for $_" } }
9694
9795
- name: Test
98-
# Uses 'dotnet pwsh' because the default shell (bash/cmd) is not PowerShell
9996
run: dotnet pwsh ./build.ps1 -Test -NoBuild -Configuration ${{ env.CONFIGURATION }}
10097

10198
- name: Integration Tests (Windows)

build.ps1

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,13 @@ Push-Location $PSScriptRoot
8484
try {
8585
function Invoke-DotNet {
8686
param(
87-
[string[]] $Arguments,
88-
[switch] $AllowTestFailures
87+
[string[]] $Arguments
8988
)
9089

9190
Write-Host "dotnet $($Arguments -join ' ')" -ForegroundColor Cyan
9291
& dotnet @Arguments
9392
if ($LASTEXITCODE -ne 0) {
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.
96-
if ($AllowTestFailures -and $LASTEXITCODE -eq 1) {
97-
Write-Host "Test command returned exit code 1 (this may be due to net47 requiring mono on Linux)" -ForegroundColor Yellow
98-
} else {
99-
throw "dotnet command failed with exit code $LASTEXITCODE"
100-
}
93+
throw "dotnet command failed with exit code $LASTEXITCODE"
10194
}
10295
}
10396

@@ -115,9 +108,7 @@ try {
115108
}
116109

117110
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
120-
Invoke-DotNet 'test', '--no-build', '--configuration', $Configuration -AllowTestFailures
111+
Invoke-DotNet 'test', '--no-build', '--configuration', $Configuration
121112

122113
# Note: Roslyn 4.4 analyzer is validated through integration tests
123114
# that use the packed NuGet package containing both analyzer variants

0 commit comments

Comments
 (0)