chore: update test script to allow running from anywhere and also clean up test results on each run

This commit is contained in:
Stevan Freeborn committed 2026-08-28 09:13:59 -05:00
1 parent 7ad14767b6
commit e6891a72ea
1 file changed
+15 -1
+15 -1
View File
@@ -1,8 +1,18 @@
$RepoRoot = Resolve-Path (Join-Path -Path $PSScriptRoot -ChildPath "..")
Push-Location -Path $RepoRoot
try {
Write-Host "Starting test execution..." -ForegroundColor Magenta
Write-Host ""
dotnet test
$TestResultsPath = Join-Path -Path $RepoRoot -ChildPath "TestResults"
if (Test-Path $TestResultsPath) {
Remove-Item -Path $TestResultsPath -Recurse -Force
}
dotnet test
$TestExitCode = $LASTEXITCODE
@@ -18,5 +28,9 @@ if ($TestExitCode -eq 0) {
} else {
Write-Host "FAILURE: Tests failed with exit code $TestExitCode. Skipping coverage report generation." -ForegroundColor Red
}
}
finally {
Pop-Location
}
exit $TestExitCode