Adds .github/workflows/win-update-e2e.yml (workflow_dispatch): on a clean windows-2022 runner, downloads two release installers, runs the update-survival harness, and uploads the output log. A CI runner is the only safe home for install-based testing — electron-builder oneClick uninstalls the registry-registered app before every install, so running the harness on a machine with a real Orca install deletes it. Also hardens the harness against that exact hazard: silentUninstall now requires an explicit install directory (no scan-and-discover fallback) and refuses the default per-user location unless a caller that owns the install opts in; non-isolated teardown uninstalls only the exact dir it installed into.
116 lines
4.4 KiB
YAML
116 lines
4.4 KiB
YAML
name: Windows Update-Survival E2E
|
|
|
|
# Why: proves what happens to terminal sessions across a real Windows app update
|
|
# by installing one released version, updating to another, and asserting on the
|
|
# packaged artifacts (daemon survival, terminal interactivity, zero console
|
|
# flashes). This MUST run on a disposable CI Windows: electron-builder's oneClick
|
|
# installer uninstalls the registry-registered copy of the app before every
|
|
# install, so running the harness on a machine with a real Orca install would
|
|
# delete it. A fresh runner has no Orca registered, so it is the only safe home
|
|
# for install-based testing. Manual dispatch only.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
from_tag:
|
|
description: Release tag to install first (e.g. v1.4.124-rc.8)
|
|
required: true
|
|
type: string
|
|
to_tag:
|
|
description: Release tag to update to (e.g. v1.4.124-rc.9)
|
|
required: true
|
|
type: string
|
|
expect:
|
|
description: Expected outcome profile
|
|
required: true
|
|
type: choice
|
|
default: cold-restore
|
|
options:
|
|
- cold-restore
|
|
- survival
|
|
asset_pattern:
|
|
description: Installer asset glob
|
|
required: false
|
|
type: string
|
|
default: '*windows-setup.exe'
|
|
soak_seconds:
|
|
description: Post-relaunch console-window watch duration
|
|
required: false
|
|
type: string
|
|
default: '60'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: win-update-e2e-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
update-e2e:
|
|
name: update ${{ inputs.from_tag }} -> ${{ inputs.to_tag }} (${{ inputs.expect }})
|
|
runs-on: windows-2022
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: package.json
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
with:
|
|
run_install: false
|
|
|
|
# Why: the harness only needs its runtime deps (the Playwright Electron
|
|
# driver); it drives already-built installer artifacts, so no app build.
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
# Why: fail fast with a readable message if a tag has no matching Windows
|
|
# installer, rather than deep inside the harness.
|
|
- name: Download installers
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
shell: pwsh
|
|
run: |
|
|
New-Item -ItemType Directory -Force artifacts/from | Out-Null
|
|
New-Item -ItemType Directory -Force artifacts/to | Out-Null
|
|
gh release download "${{ inputs.from_tag }}" --repo "${{ github.repository }}" --pattern "${{ inputs.asset_pattern }}" --dir artifacts/from
|
|
gh release download "${{ inputs.to_tag }}" --repo "${{ github.repository }}" --pattern "${{ inputs.asset_pattern }}" --dir artifacts/to
|
|
$from = Get-ChildItem artifacts/from -Filter *.exe | Select-Object -First 1
|
|
$to = Get-ChildItem artifacts/to -Filter *.exe | Select-Object -First 1
|
|
if (-not $from) { throw "No installer matching '${{ inputs.asset_pattern }}' in ${{ inputs.from_tag }}" }
|
|
if (-not $to) { throw "No installer matching '${{ inputs.asset_pattern }}' in ${{ inputs.to_tag }}" }
|
|
"FROM_EXE=$($from.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
"TO_EXE=$($to.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
# Why: no --install-dir here. A CI runner has no real Orca registered, so
|
|
# the harness installs to the default per-user location and owns it — the
|
|
# isolated-install machinery exists only to (imperfectly) protect a real
|
|
# developer install, which does not apply on a throwaway runner.
|
|
- name: Run update-survival harness
|
|
id: harness
|
|
shell: pwsh
|
|
run: |
|
|
$log = "artifacts/harness-output.log"
|
|
node tools/win-update-e2e/run.mjs `
|
|
--from "$env:FROM_EXE" `
|
|
--to "$env:TO_EXE" `
|
|
--expect "${{ inputs.expect }}" `
|
|
--soak-seconds "${{ inputs.soak_seconds }}" 2>&1 | Tee-Object -FilePath $log
|
|
exit $LASTEXITCODE
|
|
|
|
- name: Upload harness output
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: win-update-e2e-output
|
|
path: artifacts/harness-output.log
|
|
retention-days: 7
|
|
if-no-files-found: warn
|