Skip to content

The agent that grows with you

test(install-e2e): smoke hermes desktop --build-only between install and update

etherneta64b5f5cafe2
diff --git a/tests/install/README.md b/tests/install/README.md
new file mode 100644
index 00000000000..25bbab5069b
--- /dev/null
+++ b/tests/install/README.md
@@ -0,0 +1,69 @@
+# Install and Update E2E Tests
+
+These tests answer one question: can a user on a released version get to this commit?
+
+Each test leg installs an old released version, then updates it to HEAD. The install and the update run the real user surfaces. The legs do not use mocks and do not use headless proxies of GUI flows.
+
+## The layers
+
+The test family has four layers. Each layer has one job.
+
+1. `scripts/sandbox/generate-e2e-matrix.mjs` declares the support matrix. It lists every {os, install-method, update-method} pair. It expands the pairs against the sampled release tags. It knows nothing about which pairs CI can run.
+2. `.github/workflows/install-e2e.yml` is the primary workflow. It picks the release tags, runs the generator, and fans out one matrix job per OS. It also writes the plan chart and the result chart on the run summary.
+3. The run workflows own the capability knowledge. `install-e2e-run.yml` serves linux and macos with one OS-agnostic driver. `install-e2e-windows-run.yml` serves windows. A job-level `if:` gate in each run workflow lists the pairs its driver can run. All other pairs skip natively and show as grey.
+4. The drivers do the work. `tests/install/installer-script-e2e.sh` is the POSIX driver. `tests/install/windows-installer-script-e2e.ps1` is the windows script driver. `tests/install/windows-desktop-gui-e2e.ps1` is the windows GUI driver.
+
+To declare a new method, edit the generator. To implement a method, flip the gate in the run workflow and extend a driver.
+
+## The isolation trick
+
+The drivers do not touch the network for git operations. Each driver makes a bare clone of the checkout at `serve.git`. Then it points every git process at this clone. The mechanism is a driver-owned `GIT_CONFIG_GLOBAL` file with `url.<file://serve.git>.insteadOf` rewrites for both canonical repository URLs.
+
+The driver parks the `main` branch of `serve.git` at the old release. The installer runs and lands on the old release. Then the driver moves `main` to HEAD. An update becomes available in the same way that it does for a real user.
+
+The installer script is not downloaded. The install leg runs the copy from the old git ref. This is the copy that a user of that version executed. The update leg runs the copy from HEAD.
+
+## What one leg does
+
+Each leg with the script drivers has these phases:
+
+1. Stage: make the bare clone, park `main` at the old release.
+2. Install: run the old release's own installer script. Make sure that the checkout is at the old commit and that `hermes --version` works.
+3. Desktop smoke: run `hermes desktop --build-only` from the installed CLI. This proves that the installed version can build the desktop app. If the installed version does not have this flag, the phase reports a skip and continues.
+4. Update: move `main` to HEAD. Apply one update method. Make sure that the checkout is at HEAD and that `hermes --version` works.
+5. Desktop smoke again, at HEAD.
+
+The windows GUI driver replaces phases 2 and 4. It downloads the published `Hermes-Setup.exe`, clicks through the installer window with AutoHotkey, and clicks "Update now" in the running app with Playwright.
+
+## Old versions
+
+A leg can install a release from months back. The driver must not assume that the old version has today's CLI surface. The rule: probe, do not assume.
+
+- For the installer, read the flag from the old ref's own script text.
+- For the installed CLI, ask the binary with `--help`.
+- If a flag is not found, omit the flag. This is not an error.
+
+## Skips
+
+A grey leg is normal. There are two causes:
+
+- The method pair has no driver yet. The pair is a declared TODO. The gate in the run workflow lists the pairs that run.
+- The starting release predates the surface under test. Example: a release without `apps/desktop` has no window to launch. The tag annotation `tag_has_desktop` from the primary workflow marks these releases.
+
+The result chart on the run summary shows each leg as passed, failed, or skipped.
+
+## Triggers
+
+The matrix does not run on pull requests. One leg installs real toolchains and takes more than 10 minutes. The triggers are:
+
+- A schedule, every 12 hours. This finds upstream drift.
+- A release tag push. This is the moment the set of start versions changes.
+- Manual dispatch. You can select the route and the tag count:
+
+```
+gh workflow run install-e2e.yml --ref <branch> -f route=both -f tag-count=2
+```
+
+## Artifacts
+
+Each leg uploads its logs as an artifact. The windows GUI leg also uploads screenshots, a screen recording, and the update result file. Get them with `gh run download <run-id>`.
diff --git a/tests/install/installer-script-e2e.sh b/tests/install/installer-script-e2e.sh
index 3cce3287ca1..9c18cdcc77c 100755
--- a/tests/install/installer-script-e2e.sh
+++ b/tests/install/installer-script-e2e.sh
@@ -176,11 +176,39 @@ assert_checkout() {
ok "hermes --version works: $(head -c 120 "$LOG_DIR/version-$2.log" | tr -d '\n')"
}
+smoke_desktop() {
+ # $1: label (old|head). Prove the installed CLI can produce the desktop
+ # app: `hermes desktop --build-only` runs the full desktop pipeline
+ # (workspace install, renderer build, stamp write) and stops before the
+ # launch -- the same call `hermes update` itself makes. Probe the
+ # INSTALLED hermes for the flag rather than assuming this checkout's
+ # surface: sampled OLD releases may predate `hermes desktop` or
+ # --build-only entirely, and for them the phase skips, loudly.
+ local hermes="$INSTALL_DIR/venv/bin/hermes"
+ if ! "$hermes" desktop --help 2>/dev/null | grep -qF -- --build-only; then
+ ok "hermes desktop --build-only not supported at $1; skipping desktop smoke"
+ return 0
+ fi
+ local rc=0
+ (cd "$INSTALL_DIR" && "$hermes" desktop --build-only < /dev/null \
+ > "$LOG_DIR/desktop-smoke-$1.log" 2>&1) || rc=$?
+ log_group "hermes desktop --build-only ($1) transcript" "$LOG_DIR/desktop-smoke-$1.log"
+ [ "$rc" -eq 0 ] || fail "hermes desktop --build-only ($1) exited $rc; transcript above"
+ ok "hermes desktop --build-only works at $1"
+ # TODO(launch): LAUNCH the built app and auto-close it. Mechanism when
+ # the pieces land: driver-side spawn interception (a sitecustomize.py on
+ # PYTHONPATH wraps subprocess.run under an env-var opt-in and captures
+ # the real argv/cwd/env at the spawn site) + Playwright _electron.launch
+ # on the captured spec; electronApp.close() is the auto-close. Blocked
+ # on that asset and, for linux runners, on a virtual display (Xvfb).
+}
+
# --- install OLD ---------------------------------------------------------------
step "installing OLD ($INSTALL_REF) via its own scripts/install.sh"
run_installer "$OLD_SHA" old
assert_checkout "$OLD_SHA" OLD
+smoke_desktop old
# --- update OLD -> HEAD ----------------------------------------------------------
@@ -211,5 +239,6 @@ case "$UPDATE_METHOD" in
;;
esac
assert_checkout "$HEAD_SHA" HEAD
+smoke_desktop head
step "PASS: $INSTALL_REF -> HEAD via $UPDATE_METHOD"
diff --git a/tests/install/windows-installer-script-e2e.ps1 b/tests/install/windows-installer-script-e2e.ps1
index 58a8d8944af..34157ccd81c 100644
--- a/tests/install/windows-installer-script-e2e.ps1
+++ b/tests/install/windows-installer-script-e2e.ps1
@@ -167,11 +167,52 @@ function Assert-Checkout {
Ok "hermes --version works: $((Get-Content -LiteralPath $verLog -First 1))"
}
+function Test-DesktopSmoke {
+ param([string]$Label)
+ # Prove the installed CLI can produce the desktop app: `hermes desktop
+ # --build-only` runs the full desktop pipeline (workspace install,
+ # renderer build, stamp write) and stops before the launch -- the same
+ # call `hermes update` itself makes. Probe the INSTALLED hermes for the
+ # flag rather than assuming this checkout's surface: sampled OLD
+ # releases may predate `hermes desktop` or --build-only entirely, and
+ # for them the phase skips, loudly.
+ $hermes = Join-Path $InstallDir "venv\Scripts\hermes.exe"
+ $prevEap = $ErrorActionPreference; $ErrorActionPreference = "Continue"
+ $helpText = & $hermes desktop --help 2>&1 | Out-String
+ $ErrorActionPreference = $prevEap
+ if ($helpText -notmatch '--build-only') {
+ Ok "hermes desktop --build-only not supported at $Label; skipping desktop smoke"
+ return
+ }
+ $log = Join-Path $LogDir "desktop-smoke-$Label.log"
+ $prevEap = $ErrorActionPreference; $ErrorActionPreference = "Continue"
+ Push-Location $InstallDir
+ try {
+ & $hermes desktop --build-only *> $log
+ $smokeExit = $LASTEXITCODE
+ } finally {
+ Pop-Location
+ $ErrorActionPreference = $prevEap
+ }
+ Write-LogGroup "hermes desktop --build-only ($Label) transcript" $log
+ if ($smokeExit -ne 0) {
+ Fail "hermes desktop --build-only ($Label) exited $smokeExit; transcript above"
+ }
+ Ok "hermes desktop --build-only works at $Label"
+ # TODO(launch): LAUNCH the built app and auto-close it. Mechanism when
+ # the pieces land: driver-side spawn interception (a sitecustomize.py
+ # on PYTHONPATH wraps subprocess.run under an env-var opt-in and
+ # captures the real argv/cwd/env at the spawn site) + Playwright
+ # _electron.launch on the captured spec; electronApp.close() is the
+ # auto-close.
+}
+
# --- install OLD ------------------------------------------------------------------
Step "installing OLD ($InstallRef) via its own scripts/install.ps1"
Invoke-Installer $OldSha "old"
Assert-Checkout $OldSha "OLD"
+Test-DesktopSmoke "old"
# --- update OLD -> HEAD --------------------------------------------------------------
@@ -209,5 +250,6 @@ switch ($UpdateMethod) {
}
}
Assert-Checkout $HeadSha "HEAD"
+Test-DesktopSmoke "head"
Step "PASS: $InstallRef -> HEAD via $UpdateMethod"