Files
kefu/deploy/patient-session-20260918/validate_patient_v1_4_25.ps1
T
2026-09-21 10:34:06 +08:00

23 lines
1.8 KiB
PowerShell

param([switch]$Finalized)
$ErrorActionPreference = 'Stop'
if (-not $Finalized) { throw 'Finalized root review required' }
$taskPlan = Get-Content -Raw -LiteralPath (Join-Path $PSScriptRoot 'patient-release-plan.json') | ConvertFrom-Json
if (-not $taskPlan.finalized) { throw 'Unfinished release plan' }
$taskBuildLog = Get-Content -Raw -LiteralPath (Join-Path $PSScriptRoot 'patient-app-build.log')
if (-not $taskBuildLog.Contains('Packaged Qt WebEngine self-check passed')) { throw 'Packaged self-check did not pass' }
$taskPython = Join-Path $taskPlan.windowsRoot '.build-venv\Scripts\python.exe'
$env:LOCALAPPDATA = Join-Path $PSScriptRoot 'qa-profile\Local'
$env:APPDATA = Join-Path $PSScriptRoot 'qa-profile\Roaming'
$env:QT_QPA_PLATFORM = 'offscreen'
$env:PYTHONDONTWRITEBYTECODE = '1'
New-Item -ItemType Directory -Path $env:LOCALAPPDATA,$env:APPDATA -Force | Out-Null
& $taskPython -B (Join-Path $PSScriptRoot 'verify_patient_frozen.py')
if ($LASTEXITCODE -ne 0) { throw 'Frozen module/source verification failed' }
& $taskPython -B (Join-Path $PSScriptRoot 'run_patient_frozen_regressions.py') *> (Join-Path $PSScriptRoot 'patient-frozen-runner.log')
if ($LASTEXITCODE -ne 0) { throw 'Frozen synthetic regression failed' }
$taskResults = Get-Content -Raw -LiteralPath (Join-Path $PSScriptRoot 'frozen-patient-tests.json') | ConvertFrom-Json
if ($taskResults.tests_run -le 0 -or $taskResults.failures -ne 0 -or $taskResults.errors -ne 0 -or $taskResults.blocked_external_actions.Count -ne 0) { throw 'Frozen regression incomplete or attempted external operation' }
& $taskPython -B (Join-Path $PSScriptRoot 'verify_patient_nsis.py')
if ($LASTEXITCODE -ne 0) { throw 'Installer integrity failed' }
Write-Output 'v1.4.25 frozen modules, private-file exclusion, synthetic regressions and installer payload verified. Not installed or published.'