Files
kefu/deploy/plaintext-chat-20260918/validate_plaintext_chat_v1_4_29.ps1
T
2026-09-21 10:34:06 +08:00

30 lines
2.6 KiB
PowerShell

param([switch]$Finalized)
$ErrorActionPreference = 'Stop'
if (-not $Finalized) { throw 'Finalized root review required' }
$taskPlan = Get-Content -Raw -LiteralPath (Join-Path $PSScriptRoot 'plaintext-chat-release-plan.json') | ConvertFrom-Json
if (-not $taskPlan.finalized -or $taskPlan.version -ne '1.4.29') { throw 'Unfinished or wrong-version release plan' }
$taskBuildLog = Get-Content -Raw -LiteralPath (Join-Path $PSScriptRoot 'plaintext-chat-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_plaintext_chat_frozen.py')
if ($LASTEXITCODE -ne 0) { throw 'Frozen module/source verification failed' }
& $taskPython -B (Join-Path $PSScriptRoot 'run_plaintext_chat_frozen_regressions.py') *> (Join-Path $PSScriptRoot 'plaintext-chat-frozen-runner.log')
if ($LASTEXITCODE -ne 0) { throw 'Frozen synthetic regression failed' }
$taskResults = Get-Content -Raw -LiteralPath (Join-Path $PSScriptRoot 'frozen-plaintext-chat-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' }
if ($taskResults.skipped -gt [int]$taskPlan.allowedSkippedTests) { throw 'Unexpected skipped frozen tests' }
& $taskPython -B (Join-Path $PSScriptRoot 'verify_frozen_plaintext_chat_notifications.py')
if ($LASTEXITCODE -ne 0) { throw 'Frozen review/manual notification tests failed' }
& $taskPython -I -S (Join-Path $PSScriptRoot 'verify_frozen_offline_asr.py')
if ($LASTEXITCODE -ne 0) { throw 'Actual frozen offline ASR verification failed' }
& $taskPython -B (Join-Path $PSScriptRoot 'verify_plaintext_chat_nsis.py')
if ($LASTEXITCODE -ne 0) { throw 'Installer integrity failed' }
$taskOld = Join-Path $taskPlan.windowsRoot 'releases\甄AI客服-安装包-v1.4.28.exe'
if ((Get-FileHash -LiteralPath $taskOld -Algorithm SHA256).Hash.ToLowerInvariant() -ne 'dc5a4d73dce176159b16d8ee72e5291b32868cdfb539dec0fc2dfc93c8cb775f') { throw 'Old v1.4.28 installer changed' }
Write-Output 'v1.4.29 frozen modules, private-file exclusion, synthetic regressions and installer payload verified. Not installed or published.'