# ============================================================================== # ClassNotify P1 RC2 Regression Test: In-Place Upgrade Quiesce & File Lock Protection # Test Suite: tests/test_upgrade_quiesce_regression.ps1 # Covers: # 1. QuiesceExistingInstallationOrThrow cleanly completes when no processes/services running (Fresh install path) # 2. WaitUntilNoProcess immediate return when process not present # 3. WaitUntilNoProcess waits for target process to exit # 4. Quiesce terminates running Client processes before binary copy # 5. Fail-closed verification: Throws InvalidOperationException on stubborn process # ============================================================================== $ErrorActionPreference = "Stop" $root = Resolve-Path (Join-Path $PSScriptRoot "..") $dotnet = "C:\Program Files\dotnet\dotnet.exe" if (-not (Test-Path $dotnet)) { $dotnet = (Get-Command dotnet -ErrorAction SilentlyContinue).Source } Write-Host "==========================================================" -ForegroundColor Cyan Write-Host " ClassNotify P1 RC2 Regression: Upgrade Quiesce & Locks " -ForegroundColor Cyan Write-Host "==========================================================" -ForegroundColor Cyan $testProj = Join-Path $root "tests\ClassNotify.SetupTests\ClassNotify.SetupTests.csproj" if (-not (Test-Path $testProj)) { Write-Error "Test project not found: $testProj" exit 1 } & $dotnet run --project $testProj $exitCode = $LASTEXITCODE if ($exitCode -ne 0) { Write-Host "`nRegression test suite FAILED with exit code $exitCode" -ForegroundColor Red exit $exitCode } else { Write-Host "`nRegression test suite PASSED successfully." -ForegroundColor Green exit 0 }