提交记录修改scripts/test-windows-install.ps1+3 −11看文件
| @@ -5,7 +5,6 @@ param([Parameter(Mandatory)][string]$Installer) | ||
| 5 | 5 | . (Join-Path $PSScriptRoot 'windows-common.ps1') |
| 6 | 6 | if (-not $IsWindows) { throw 'Installation smoke tests must run on Windows.' } |
| 7 | 7 | $target = Join-Path $env:LOCALAPPDATA ('Programs/Cage-test-' + [guid]::NewGuid().ToString('N')) |
| 8 | 删除:$report = Join-Path ([IO.Path]::GetTempPath()) ('cage-smoke-' + [guid]::NewGuid().ToString('N') + '.json') | |
| 9 | 8 | $savedKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\ClaudeCage' |
| 10 | 9 | if (Test-Path $savedKey) { throw 'Use a disposable Windows user without an existing Cage installation.' } |
| 11 | 10 | $fixture = Join-Path $PSScriptRoot 'personal-data-fixture.mjs' |
| @@ -74,17 +73,10 @@ Invoke-BuildTool (Join-Path $target 'resources/cage.exe') @('verify-web-assets') | ||
| 74 | 73 | Invoke-BuildTool (Join-Path $target 'resources/mihomo.exe') @('-v') |
| 75 | 74 | Invoke-BuildTool (Join-Path $target 'resources/runtime/qemu/qemu-system-x86_64.exe') @('--version') |
| 76 | 75 | Invoke-BuildTool (Join-Path $target 'resources/runtime/openssh/ssh.exe') @('-V') |
| 77 | 删除:$savedProfile = $env:CLAUDE_CAGE_CONFIG | |
| 78 | 删除:try { | |
| 79 | 删除: # The UI test owns a separate profile; the installer must preserve the | |
| 80 | 删除: # pre-existing default profile without asking the app to parse test bytes. | |
| 81 | 删除: $env:CLAUDE_CAGE_CONFIG = Join-Path ([IO.Path]::GetTempPath()) ('cage-ui-profile-' + [guid]::NewGuid().ToString('N') + '/config.json') | |
| 82 | 删除: $window = Start-Process -FilePath (Join-Path $target 'Cage.exe') -ArgumentList @('--smoke-test', "`"$report`"") -PassThru | |
| 83 | 删除: if (-not $window.WaitForExit(180000)) { throw 'Cage WebView2/workbench smoke test timed out.' } | |
| 84 | 删除: if ($window.ExitCode -ne 0 -or -not (Test-Path -LiteralPath $report)) { throw "Cage desktop smoke test failed ($($window.ExitCode))." } | |
| 85 | 删除:} finally { $env:CLAUDE_CAGE_CONFIG = $savedProfile } | |
| 76 | 新增:# Use the same isolated profile, process lifetime and retained diagnostics as | |
| 77 | 新增:# build acceptance. The pre-existing default profile holds preservation markers. | |
| 78 | 新增:Assert-WindowsWorkbench -AppDirectory $target | |
| 86 | 79 | Assert-PersonalData |
| 87 | 删除:Get-Content -LiteralPath $report | |
| 88 | 80 | # A locked installed executable must fail before replacing the installation. |
| 89 | 81 | $before = (Get-FileHash -LiteralPath (Join-Path $target 'Cage.exe') -Algorithm SHA256).Hash |
| 90 | 82 | $locked = [IO.File]::Open((Join-Path $target 'Cage.exe'), [IO.FileMode]::Open, [IO.FileAccess]::Read, [IO.FileShare]::Read) |

