Skip to content

The agent that grows with you

test(install-e2e): snapshot install-side state before post-update smoke in the linux and windows drivers

ethernet382b5de79e41
diff --git a/tests/install/installer-script-e2e.sh b/tests/install/installer-script-e2e.sh
index 7aececdffa3..834ec143f25 100755
--- a/tests/install/installer-script-e2e.sh
+++ b/tests/install/installer-script-e2e.sh
@@ -464,6 +464,24 @@ case "$UPDATE_METHOD" in
ok "node_modules cleared for the head desktop smoke"
;;
esac
+
+# Install-side state BEFORE the post-update assertions: on app-update legs
+# the updater's transcript is streamed into the app UI (or runs detached)
+# and is otherwise lost, so snapshot every place it also lands — product
+# logs, update hand-off files, the venv's entry-point dir — while the
+# install is still there to inspect. The assertions below can `fail` out
+# of the driver; the evidence must already be on disk when they do.
+ildest="$LOG_DIR/install-logs"
+mkdir -p "$ildest"
+cp -R "$HERMES_HOME/logs" "$ildest/hermes-logs" 2>/dev/null || true
+if [ -n "${XDG_DATA_HOME:-}" ]; then
+ cp -R "$XDG_DATA_HOME/hermes/logs" "$ildest/desktop-userdata-logs" 2>/dev/null || true
+fi
+cp "$HERMES_HOME/.hermes-update-result.json" "$ildest" 2>/dev/null || true
+ls -la "$HERMES_HOME" > "$ildest/hermes-home-ls.txt" 2>/dev/null || true
+ls -la "$INSTALL_DIR/venv/bin" > "$ildest/venv-bin-ls.txt" 2>/dev/null || true
+ok "collected install-side logs to $ildest"
+
assert_checkout "$HEAD_SHA" HEAD
smoke_desktop head
diff --git a/tests/install/windows-e2e.ps1 b/tests/install/windows-e2e.ps1
index 2d845a3238b..ec8bc61d673 100644
--- a/tests/install/windows-e2e.ps1
+++ b/tests/install/windows-e2e.ps1
@@ -280,7 +280,37 @@ function Get-DesktopExe {
return $null
}
+# Install-side state snapshot, taken BEFORE Test-HermesRuns can throw: on
+# app-update legs the updater runs detached and its transcript lands in the
+# product logs and hand-off files, not in this driver. Copy those plus the
+# venv entry-point dir while the install is still there to inspect, so a
+# failed post-update assertion leaves its evidence in the proof tree.
+function Save-InstallSideState([string]$Label) {
+ $dest = Join-Path $ProofRoot "install-side-$Label"
+ New-Item -ItemType Directory -Path $dest -Force | Out-Null
+ $logsDir = Join-Path $HermesHome "logs"
+ if (Test-Path -LiteralPath $logsDir) {
+ Copy-Item $logsDir (Join-Path $dest "hermes-logs") -Recurse -Force -ErrorAction SilentlyContinue
+ }
+ $resultFile = Join-Path $HermesHome ".hermes-update-result.json"
+ if (Test-Path -LiteralPath $resultFile) {
+ Copy-Item $resultFile $dest -Force -ErrorAction SilentlyContinue
+ }
+ $venvScripts = Join-Path $InstallDir "venv\Scripts"
+ if (Test-Path -LiteralPath $venvScripts) {
+ Get-ChildItem -LiteralPath $venvScripts |
+ Select-Object Name, Length, LastWriteTime |
+ Format-Table -AutoSize | Out-String |
+ Set-Content (Join-Path $dest "venv-scripts-ls.txt")
+ }
+ Get-ChildItem -LiteralPath $HermesHome -ErrorAction SilentlyContinue |
+ Select-Object Name, Length, LastWriteTime |
+ Format-Table -AutoSize | Out-String |
+ Set-Content (Join-Path $dest "hermes-home-ls.txt")
+}
+
function Test-HermesRuns([string]$Label) {
+ Save-InstallSideState $Label
$hermesExe = Join-Path $InstallDir "venv\Scripts\hermes.exe"
Assert-True (Test-Path -LiteralPath $hermesExe) "$Label -- venv\Scripts\hermes.exe exists"
& $hermesExe --version 2>&1 | ForEach-Object { Write-Host " hermes --version| $_" }