Skip to content

The agent that grows with you

test(install-e2e): same next-startup step for the windows harness

ethernet2992d1bbea64
diff --git a/tests/install/e2e-assets/source-driver.ps1 b/tests/install/e2e-assets/source-driver.ps1
index b28a8842f26..eca4dd7393e 100644
--- a/tests/install/e2e-assets/source-driver.ps1
+++ b/tests/install/e2e-assets/source-driver.ps1
@@ -16,4 +16,26 @@ function Get-SourceHermes([string]$Root) {
$legacy = Join-Path $Root 'venv/Scripts/hermes.exe'
if (Test-Path -LiteralPath $legacy -PathType Leaf) { return $legacy }
throw "No installed Hermes command under $Root"
-}
\ No newline at end of file
+}
+
+# Hand out a command to DRIVE the next ordinary startup, even when the
+# published launcher is not there yet.
+#
+# A pre-handoff release cannot flip during `hermes update` -- there is no
+# retired-hook seam on its update path to reach, so the update ends with the
+# tree at HEAD and no `.hermes/bin/*`. The NEXT ordinary startup is what
+# completes it: hermes_bootstrap calls prepare_launch() before importing
+# anything, which syncs PM, publishes the launchers and re-execs.
+#
+# Deliberately NOT used for `--version` probes: those stay under
+# HERMES_DISABLE_LAZY_INSTALLS so a probe can never complete an unfinished
+# update. Only a real startup may heal.
+function Get-SourceHermesForStartup([string]$Root) {
+ foreach ($name in @('hermes.exe', 'hermes.cmd')) {
+ $published = Join-Path $Root ".hermes/bin/$name"
+ if (Test-Path -LiteralPath $published -PathType Leaf) { return $published }
+ }
+ $legacy = Join-Path $Root 'venv/Scripts/hermes.exe'
+ if (Test-Path -LiteralPath $legacy -PathType Leaf) { return $legacy }
+ throw "No installed Hermes command to start under $Root"
+}
diff --git a/tests/install/windows-e2e.ps1 b/tests/install/windows-e2e.ps1
index 8ad51530430..da431f1957e 100644
--- a/tests/install/windows-e2e.ps1
+++ b/tests/install/windows-e2e.ps1
@@ -357,7 +357,26 @@ function Save-InstallSideState([string]$Label) {
function Test-HermesRuns([string]$Label) {
Save-InstallSideState $Label
- $hermesExe = Get-SourceHermes $InstallDir
+ $hermesExe = $null
+ try {
+ $hermesExe = Get-SourceHermes $InstallDir
+ } catch {
+ # A pre-handoff release cannot complete inside `hermes update`: its
+ # update path reaches no retired-hook seam, so the update ends with the
+ # tree at HEAD and no published launcher. The NEXT ordinary startup
+ # completes it (hermes_bootstrap -> prepare_launch -> sync PM, publish
+ # launchers, re-exec). Drive that startup here, WITHOUT the lazy-install
+ # ban, and only when the launcher is missing -- so a healthy update is
+ # still judged by the strict checks below, and `--version` probes keep
+ # their ban: a probe must never complete an unfinished update.
+ Write-Host " no published launcher yet; running the next ordinary startup (this is what completes a pre-handoff release)"
+ $startupHermes = Get-SourceHermesForStartup $InstallDir
+ $startupLog = Join-Path $WorkRoot 'logs\post-update-startup.log'
+ New-Item -ItemType Directory -Force -Path (Split-Path $startupLog) | Out-Null
+ & $startupHermes status *> $startupLog
+ Write-Host " first startup after the update ran (exit $LASTEXITCODE); the checks below assert the launcher it must have published"
+ $hermesExe = Get-SourceHermes $InstallDir
+ }
& python -B (Join-Path $AssetsDir 'source_driver.py') --root $InstallDir --launcher $hermesExe --desktop $script:ExpectedDesktop
Assert-True ($LASTEXITCODE -eq 0) "$Label -- read-only install verification (no repair)"
$prevLazy = $env:HERMES_DISABLE_LAZY_INSTALLS