The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(install-e2e): installer-script+desktop is its own install and update method
ethernet239523414e1b
diff --git a/.github/workflows/install-e2e-run.yml b/.github/workflows/install-e2e-run.ymlindex e7501ec07f5..e61f1db3913 100644--- a/.github/workflows/install-e2e-run.yml+++ b/.github/workflows/install-e2e-run.yml@@ -38,11 +38,11 @@ on:workflow_call:inputs:install-method:- description: 'How the starting version gets installed. Supported: installer-script (the real curl | install.sh one-liner).'+ description: 'How the starting version gets installed. Supported: installer-script (the real curl | install.sh one-liner) and installer-script+desktop (the same one-liner with --include-desktop).'required: truetype: stringupdate-method:- description: 'How the install updates to HEAD. Supported: hermes-update (the updater) or installer-script (re-run the one-liner). Declared-but-TODO methods (open-app-update, hermes-desktop-app-update) skip.'+ description: 'How the install updates to HEAD. Supported: hermes-update (the updater), installer-script (re-run the one-liner), installer-script+desktop (re-run with --include-desktop). Declared-but-TODO methods (open-app-update, hermes-desktop-app-update) skip.'required: truetype: stringinstall-ref:@@ -73,8 +73,13 @@ jobs:e2e:name: install & update# The pairs the driver can run today; anything else is a declared TODO- # and natively skips.- if: inputs.install-method == 'installer-script' && contains(fromJSON('["hermes-update", "installer-script"]'), inputs.update-method)+ # and natively skips. The +desktop variants also need the starting tag+ # to ship apps/desktop (the --include-desktop flag shipped with it).+ if: >-+ (inputs.install-method == 'installer-script'+ || (inputs.install-method == 'installer-script+desktop' && inputs.tag-has-desktop))+ && (contains(fromJSON('["hermes-update", "installer-script"]'), inputs.update-method)+ || (inputs.update-method == 'installer-script+desktop' && inputs.tag-has-desktop))runs-on: ${{ inputs.runner }}timeout-minutes: ${{ inputs.timeout-minutes }}@@ -90,6 +95,7 @@ jobs:run: |set -euo pipefailtests/install/installer-script-e2e.sh \+ --install-method '${{ inputs.install-method }}' \--update-method '${{ inputs.update-method }}' \--install-ref '${{ inputs.install-ref }}'env:diff --git a/.github/workflows/install-e2e-windows-run.yml b/.github/workflows/install-e2e-windows-run.ymlindex 2975ad579d6..09303dc0a61 100644--- a/.github/workflows/install-e2e-windows-run.yml+++ b/.github/workflows/install-e2e-windows-run.yml@@ -58,7 +58,7 @@ on:workflow_call:inputs:install-method:- description: 'How OLD gets installed. Supported: desktop-installer@latest (website exe, AHK-clicked) and installer-script (irm | iex install.ps1). Declared-but-TODO methods skip.'+ description: 'How OLD gets installed. Supported: desktop-installer@latest (website exe, AHK-clicked), installer-script (irm | iex install.ps1) and installer-script+desktop (the same with -IncludeDesktop). Declared-but-TODO methods skip.'required: truetype: stringupdate-method:@@ -190,8 +190,13 @@ jobs:# The pairs the script driver can run today. open-app-update and# hermes-desktop-app-update from a script install are declared TODOs# (the desktop app also has to be BUILT by- # that path first).- if: inputs.install-method == 'installer-script' && contains(fromJSON('["hermes-update", "installer-script"]'), inputs.update-method)+ # that path first). The +desktop variants also need the starting tag+ # to ship apps/desktop (the -IncludeDesktop parameter shipped with it).+ if: >-+ (inputs.install-method == 'installer-script'+ || (inputs.install-method == 'installer-script+desktop' && inputs.tag-has-desktop))+ && (contains(fromJSON('["hermes-update", "installer-script"]'), inputs.update-method)+ || (inputs.update-method == 'installer-script+desktop' && inputs.tag-has-desktop))runs-on: windows-latesttimeout-minutes: ${{ inputs.timeout-minutes }}@@ -205,7 +210,7 @@ jobs:- name: Run install + update E2Eshell: powershell- run: powershell -NoProfile -ExecutionPolicy Bypass -File tests\install\windows-installer-script-e2e.ps1 -UpdateMethod "${{ inputs.update-method }}" -InstallRef "${{ inputs.install-ref }}"+ run: powershell -NoProfile -ExecutionPolicy Bypass -File tests\install\windows-installer-script-e2e.ps1 -InstallMethod "${{ inputs.install-method }}" -UpdateMethod "${{ inputs.update-method }}" -InstallRef "${{ inputs.install-ref }}"env:HERMES_E2E_LOG_DIR: ${{ runner.temp }}\e2e-logsdiff --git a/scripts/sandbox/generate-e2e-matrix.mjs b/scripts/sandbox/generate-e2e-matrix.mjsindex 2011f531fb2..16cb8e176f1 100644--- a/scripts/sandbox/generate-e2e-matrix.mjs+++ b/scripts/sandbox/generate-e2e-matrix.mjs@@ -37,10 +37,14 @@ import { fileURLToPath } from 'node:url';* @typedef {'latest'} InstallerVersion* The artifact published on the website right now -- Hermes-Setup.exe has* no versioned archive yet. Widen this union when one exists.- * @typedef {'installer-script' | 'desktop-installer' | 'packaged-app'} InstallMethod+ * @typedef {'installer-script' | 'installer-script+desktop' | 'desktop-installer' | 'packaged-app'} InstallMethod* installer-script is the platform's one-liner (curl | bash on- * linux/macos, irm | iex on windows); packaged-app is declared but not- * used by any OS spec yet.+ * linux/macos, irm | iex on windows); installer-script+desktop is the+ * same one-liner with its desktop stage opted in (--include-desktop /+ * -IncludeDesktop), which also builds the desktop app -- on windows it+ * registers Start Menu / Desktop shortcuts too, on linux/macos it+ * builds into the checkout without registering an OS entry point;+ * packaged-app is declared but not used by any OS spec yet.* @typedef {InstallMethod | 'hermes-update' | 'open-app-update' | 'hermes-desktop-app-update'} UpdateMethod* Every install method doubles as an update method (re-run it over the* existing install), plus the updater CLI and the two app-update@@ -78,11 +82,16 @@ export const SPEC = {install: [// irm https://hermes.nousresearch.com/install.ps1 | iex{ method: 'installer-script' },+ // The same one-liner with -IncludeDesktop: builds Hermes.exe AND+ // registers Start Menu / Desktop shortcuts, so it is a second real+ // path to a hand-launchable app.+ { method: 'installer-script+desktop' },// Website Hermes-Setup.exe, clicked through the GUI.{ method: 'desktop-installer', versions: ['latest'] },],update: [{ method: 'installer-script' },+ { method: 'installer-script+desktop' },// Run the bootstrap exe again over an existing install (--update flow).{ method: 'desktop-installer', versions: ['latest'] },{ method: 'hermes-update' },@@ -96,9 +105,11 @@ export const SPEC = {macos: {install: [{ method: 'installer-script' },+ { method: 'installer-script+desktop' },],update: [{ method: 'installer-script' },+ { method: 'installer-script+desktop' },{ method: 'hermes-update' },// install.sh --include-desktop builds the .app inside the checkout// but registers no OS entry point, so open-app-update legs pair@@ -110,9 +121,11 @@ export const SPEC = {linux: {install: [{ method: 'installer-script' },+ { method: 'installer-script+desktop' },],update: [{ method: 'installer-script' },+ { method: 'installer-script+desktop' },{ method: 'hermes-update' },// No desktop installer and no packaged desktop artifact exist for// linux, so there is no open-app-update; `hermes desktop` is always@@ -202,7 +215,8 @@ export function buildMatrices(envs, tags) {*/export function renderMarkdownPlan(envs, tags) {const needsDesktop = (/** @type {string} */ m) =>- m.startsWith('desktop-installer') || m === 'open-app-update' || m === 'hermes-desktop-app-update';+ m.startsWith('desktop-installer') || m === 'installer-script+desktop' ||+ m === 'open-app-update' || m === 'hermes-desktop-app-update';const lines = ['### Install & Update E2E plan','',diff --git a/tests/install/README.md b/tests/install/README.mdindex be5b75b9568..0e36ebb6d9b 100644--- a/tests/install/README.md+++ b/tests/install/README.md@@ -43,6 +43,12 @@ A leg can install a release from months back. The driver must not assume that th- For the installed CLI, ask the binary with `--help`.- If a flag is not found, omit the flag. This is not an error.+## The install methods++- `installer-script`: the platform's one-liner (`curl | bash` on linux and macos, `irm | iex` on windows).+- `installer-script+desktop`: the same one-liner with its desktop stage opted in (`--include-desktop` / `-IncludeDesktop`). The stage builds the desktop app during the install. On windows it also registers Start Menu and Desktop shortcuts. On linux and macos it builds the app inside the checkout and registers no OS entry point.+- `desktop-installer@latest`: the published GUI installer (`Hermes-Setup.exe` on windows), clicked through the real window.+## The two app-update variantsThe desktop app has two launch paths, so the matrix has two app-update methods. Both click "Update now" in the running app. They differ in how the app starts:diff --git a/tests/install/installer-script-e2e.sh b/tests/install/installer-script-e2e.shindex 9c18cdcc77c..d2e1a0a009c 100755--- a/tests/install/installer-script-e2e.sh+++ b/tests/install/installer-script-e2e.sh@@ -25,11 +25,16 @@# the checkout landed on HEAD with a working `hermes`## Usage:-# tests/install/installer-script-e2e.sh --update-method hermes-update|installer-script+# tests/install/installer-script-e2e.sh --update-method hermes-update|installer-script|installer-script+desktop+# [--install-method installer-script|installer-script+desktop]# [--install-ref REF]#+# --install-method installer-script the plain one-liner (default)+# installer-script+desktop the one-liner with its desktop+# stage opted in (--include-desktop)# --update-method hermes-update `hermes update`# installer-script re-run install.sh (HEAD's copy)+# installer-script+desktop re-run with --include-desktop# --install-ref what to install first; anything git resolves. Default:# the newest release tag in the checkout.#@@ -37,23 +42,31 @@set -euo pipefail+INSTALL_METHOD="installer-script"UPDATE_METHOD=""INSTALL_REF=""while [ "$#" -gt 0 ]; docase "$1" in+ --install-method)+ [ "$#" -ge 2 ] || { echo 'error: --install-method needs a value' >&2; exit 1; }+ INSTALL_METHOD="$2"; shift 2 ;;--update-method)[ "$#" -ge 2 ] || { echo 'error: --update-method needs a value' >&2; exit 1; }UPDATE_METHOD="$2"; shift 2 ;;--install-ref)[ "$#" -ge 2 ] || { echo 'error: --install-ref needs a value' >&2; exit 1; }INSTALL_REF="$2"; shift 2 ;;- -h|--help) sed -n '2,37p' "$0"; exit 0 ;;+ -h|--help) sed -n '2,45p' "$0"; exit 0 ;;*) echo "error: unknown argument: $1" >&2; exit 1 ;;esacdone+case "$INSTALL_METHOD" in+ installer-script|installer-script+desktop) ;;+ *) echo "error: --install-method must be installer-script or installer-script+desktop, got '$INSTALL_METHOD'" >&2; exit 1 ;;+esaccase "$UPDATE_METHOD" in- hermes-update|installer-script) ;;- *) echo "error: --update-method must be hermes-update or installer-script, got '$UPDATE_METHOD'" >&2; exit 1 ;;+ hermes-update|installer-script|installer-script+desktop) ;;+ *) echo "error: --update-method must be hermes-update, installer-script or installer-script+desktop, got '$UPDATE_METHOD'" >&2; exit 1 ;;esacREPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"@@ -144,7 +157,8 @@ installer_supports() {}run_installer() {- # $1: ref whose scripts/install.sh to run; $2: log name+ # $1: ref whose scripts/install.sh to run; $2: log name; $3: "desktop" to+ # opt the desktop stage in (--include-desktop)local script="$WORK_ROOT/install-$2.sh"git -C "$REPO_ROOT" show "$1:scripts/install.sh" > "$script"chmod +x "$script"@@ -155,6 +169,15 @@ run_installer() {if installer_supports "$1" "--skip-browser"; thenflags+=(--skip-browser)fi+ if [ "${3:-}" = "desktop" ]; then+ # The desktop stage is the point of this leg, so a ref without the+ # flag is a hard failure, not a silent downgrade to a plain install.+ # (Releases that predate apps/desktop are already skipped upstream by+ # the tag-has-desktop gate; the flag shipped with the app.)+ installer_supports "$1" "--include-desktop" \+ || fail "ref $1 does not support --include-desktop; this leg cannot mean what it claims"+ flags+=(--include-desktop)+ fi# </dev/null: the script reads prompts from stdin when a tty is absent;# EOF makes every remaining prompt take its default.local rc=0@@ -163,6 +186,26 @@ run_installer() {[ "$rc" -eq 0 ] || fail "install.sh ($2) exited $rc; transcript above, log at $LOG_DIR/install-$2.log"}+assert_desktop_artifact() {+ # $1: label. After a +desktop install the built app must exist under the+ # checkout -- install.sh builds it there and registers no OS entry point.+ local release_dir="$INSTALL_DIR/apps/desktop/release"+ local found=""+ local cand+ for cand in \+ "$release_dir/linux-unpacked/Hermes" \+ "$release_dir/linux-unpacked/hermes" \+ "$release_dir/mac-arm64/Hermes.app" \+ "$release_dir/mac/Hermes.app"; do+ if [ -x "$cand" ] || [ -d "$cand" ]; then+ found="$cand"+ break+ fi+ done+ [ -n "$found" ] || fail "no desktop app under $release_dir after $1 (+desktop install)"+ ok "desktop app built by installer at $1: $found"+}+assert_checkout() {# $1: expected sha, $2: labellocal got@@ -205,9 +248,15 @@ smoke_desktop() {# --- install OLD ----------------------------------------------------------------step "installing OLD ($INSTALL_REF) via its own scripts/install.sh"-run_installer "$OLD_SHA" old-assert_checkout "$OLD_SHA" OLD+step "installing OLD ($INSTALL_REF) via its own scripts/install.sh ($INSTALL_METHOD)"+if [ "$INSTALL_METHOD" = "installer-script+desktop" ]; then+ run_installer "$OLD_SHA" old desktop+ assert_checkout "$OLD_SHA" OLD+ assert_desktop_artifact OLD+else+ run_installer "$OLD_SHA" old+ assert_checkout "$OLD_SHA" OLD+fismoke_desktop old# --- update OLD -> HEAD ----------------------------------------------------------@@ -237,6 +286,10 @@ case "$UPDATE_METHOD" in# A user re-running the one-liner today gets the CURRENT script.run_installer "$HEAD_SHA" head;;+ installer-script+desktop)+ run_installer "$HEAD_SHA" head desktop+ assert_desktop_artifact HEAD+ ;;esacassert_checkout "$HEAD_SHA" HEADsmoke_desktop headdiff --git a/tests/install/windows-installer-script-e2e.ps1 b/tests/install/windows-installer-script-e2e.ps1index 34157ccd81c..53fdf4cca89 100644--- a/tests/install/windows-installer-script-e2e.ps1+++ b/tests/install/windows-installer-script-e2e.ps1@@ -31,7 +31,9 @@#Requires -Version 5.1param(- [ValidateSet("hermes-update", "installer-script")]+ [ValidateSet("installer-script", "installer-script+desktop")]+ [string]$InstallMethod = "installer-script",+ [ValidateSet("hermes-update", "installer-script", "installer-script+desktop")][string]$UpdateMethod = "hermes-update",[string]$InstallRef = "auto")@@ -123,7 +125,7 @@ $env:HERMES_HOME = $HermesHomeSet-Content -LiteralPath (Join-Path $HermesHome ".skip_upstream_prompt") -Value "" -Encoding Asciifunction Invoke-Installer {- param([string]$Ref, [string]$Label)+ param([string]$Ref, [string]$Label, [switch]$IncludeDesktop)$script = Join-Path $WorkRoot "install-$Label.ps1"(Invoke-Git @("-C", $RepoRoot, "show", "$Ref`:scripts/install.ps1")) -join "`n" |Set-Content -LiteralPath $script -Encoding UTF8@@ -134,6 +136,16 @@ function Invoke-Installer {$flags = @("-SkipSetup", "-HermesHome", $HermesHome, "-InstallDir", $InstallDir)$text = Get-Content -LiteralPath $script -Rawif ($text -match '\$NonInteractive') { $flags += "-NonInteractive" }+ if ($IncludeDesktop) {+ # The desktop stage is the point of this leg, so a ref without the+ # parameter is a hard failure, not a silent downgrade to a plain+ # install. (Pre-desktop releases are already skipped upstream by+ # the tag-has-desktop gate; the parameter shipped with the app.)+ if ($text -notmatch '\$IncludeDesktop') {+ Fail "ref $Ref does not support -IncludeDesktop; this leg cannot mean what it claims"+ }+ $flags += "-IncludeDesktop"+ }$log = Join-Path $LogDir "install-$Label.log"# Native stderr (git clone progress, pip notices) must not become# terminating NativeCommandErrors under EAP=Stop; the exit code is the@@ -167,6 +179,18 @@ function Assert-Checkout {Ok "hermes --version works: $((Get-Content -LiteralPath $verLog -First 1))"}+function Assert-DesktopArtifact {+ param([string]$Label)+ # After a +desktop install the built app must exist under the checkout;+ # the installer also registers Start Menu / Desktop shortcuts, but the+ # artifact is the ground truth a headless job can check.+ $exe = Join-Path $InstallDir "apps\desktop\release\win-unpacked\Hermes.exe"+ if (-not (Test-Path -LiteralPath $exe)) {+ Fail "no desktop app at $exe after $Label (+desktop install)"+ }+ Ok "desktop app built by installer at ${Label}: $exe"+}+function Test-DesktopSmoke {param([string]$Label)# Prove the installed CLI can produce the desktop app: `hermes desktop@@ -209,9 +233,15 @@ function Test-DesktopSmoke {# --- install OLD -------------------------------------------------------------------Step "installing OLD ($InstallRef) via its own scripts/install.ps1"-Invoke-Installer $OldSha "old"-Assert-Checkout $OldSha "OLD"+Step "installing OLD ($InstallRef) via its own scripts/install.ps1 ($InstallMethod)"+if ($InstallMethod -eq "installer-script+desktop") {+ Invoke-Installer $OldSha "old" -IncludeDesktop+ Assert-Checkout $OldSha "OLD"+ Assert-DesktopArtifact "OLD"+} else {+ Invoke-Installer $OldSha "old"+ Assert-Checkout $OldSha "OLD"+}Test-DesktopSmoke "old"# --- update OLD -> HEAD --------------------------------------------------------------@@ -248,6 +278,10 @@ switch ($UpdateMethod) {# A user re-running the one-liner today gets the CURRENT script.Invoke-Installer $HeadSha "head"}+ "installer-script+desktop" {+ Invoke-Installer $HeadSha "head" -IncludeDesktop+ Assert-DesktopArtifact "HEAD"+ }}Assert-Checkout $HeadSha "HEAD"Test-DesktopSmoke "head"