Skip to content

The agent that grows with you

ci(install-e2e): full installer transcripts in the job log, folded in ::group::

ethernet31d958800117
diff --git a/tests/install/installer-script-e2e.sh b/tests/install/installer-script-e2e.sh
index 88c7327e88e..3cce3287ca1 100755
--- a/tests/install/installer-script-e2e.sh
+++ b/tests/install/installer-script-e2e.sh
@@ -69,6 +69,14 @@ SERVE_REPO="$WORK_ROOT/serve.git"
step() { printf '\n=== %s ===\n' "$*"; }
ok() { printf ' OK %s\n' "$*"; }
fail() { printf 'E2E ASSERTION FAILED: %s\n' "$*" >&2; exit 1; }
+# Full transcript in the job log, collapsed (GitHub renders ::group:: as a
+# fold; plain text anywhere else). Win or lose -- a green install's log is
+# how you diagnose the leg that fails next.
+log_group() {
+ printf '::group::%s\n' "$1"
+ cat "$2"
+ printf '::endgroup::\n'
+}
rm -rf "$WORK_ROOT"
mkdir -p "$WORK_ROOT" "$LOG_DIR"
@@ -149,10 +157,10 @@ run_installer() {
fi
# </dev/null: the script reads prompts from stdin when a tty is absent;
# EOF makes every remaining prompt take its default.
- if ! bash "$script" "${flags[@]}" < /dev/null > "$LOG_DIR/install-$2.log" 2>&1; then
- tail -50 "$LOG_DIR/install-$2.log" >&2
- fail "install.sh ($2) exited non-zero; full log in $LOG_DIR/install-$2.log"
- fi
+ local rc=0
+ bash "$script" "${flags[@]}" < /dev/null > "$LOG_DIR/install-$2.log" 2>&1 || rc=$?
+ log_group "install.sh ($2) transcript" "$LOG_DIR/install-$2.log"
+ [ "$rc" -eq 0 ] || fail "install.sh ($2) exited $rc; transcript above, log at $LOG_DIR/install-$2.log"
}
assert_checkout() {
@@ -192,10 +200,10 @@ case "$UPDATE_METHOD" in
else
update_cmd=("$HERMES" update)
fi
- if ! (cd "$INSTALL_DIR" && "${update_cmd[@]}" < /dev/null > "$LOG_DIR/update.log" 2>&1); then
- tail -50 "$LOG_DIR/update.log" >&2
- fail "hermes update exited non-zero; full log in $LOG_DIR/update.log"
- fi
+ rc=0
+ (cd "$INSTALL_DIR" && "${update_cmd[@]}" < /dev/null > "$LOG_DIR/update.log" 2>&1) || rc=$?
+ log_group "hermes update transcript" "$LOG_DIR/update.log"
+ [ "$rc" -eq 0 ] || fail "hermes update exited $rc; transcript above, log at $LOG_DIR/update.log"
;;
installer-script)
# A user re-running the one-liner today gets the CURRENT script.
diff --git a/tests/install/windows-desktop-gui-e2e.ps1 b/tests/install/windows-desktop-gui-e2e.ps1
index 03eba70aa77..9a4812babf5 100644
--- a/tests/install/windows-desktop-gui-e2e.ps1
+++ b/tests/install/windows-desktop-gui-e2e.ps1
@@ -460,11 +460,12 @@ function Invoke-PhaseInstallGui {
finally {
Stop-ScreenRecording $recording
Stop-DesktopRecorder $recorder (Join-Path $proof "desktop-frames")
- # Surface the installer's own log win or lose.
+ # Surface the installer's own log win or lose, full and folded.
$bootLog = Join-Path $HermesHome "logs\bootstrap-installer.log"
if (Test-Path -LiteralPath $bootLog) {
- Write-Host " --- bootstrap-installer.log (tail) ---"
- Get-Content -LiteralPath $bootLog -Tail 40 | ForEach-Object { Write-Host " | $_" }
+ Write-Host "::group::bootstrap-installer.log"
+ Get-Content -LiteralPath $bootLog | Write-Host
+ Write-Host "::endgroup::"
Copy-Item $bootLog $proof -Force -ErrorAction SilentlyContinue
}
}
@@ -661,8 +662,9 @@ function Invoke-GuiUpdateDesktopRoute([string]$TargetSha) {
Stop-DesktopRecorder $recorder (Join-Path $proof "desktop-frames")
$handoffLog = Join-Path $HermesHome "logs\desktop-update-handoff.log"
if (Test-Path -LiteralPath $handoffLog) {
- Write-Host " --- desktop-update-handoff.log (tail) ---"
- Get-Content -LiteralPath $handoffLog -Tail 60 | ForEach-Object { Write-Host " | $_" }
+ Write-Host "::group::desktop-update-handoff.log"
+ Get-Content -LiteralPath $handoffLog | Write-Host
+ Write-Host "::endgroup::"
Copy-Item $handoffLog (Join-Path $proof "desktop-update-handoff.log") -Force -ErrorAction SilentlyContinue
}
# Quit the relaunched app so job teardown is clean.
diff --git a/tests/install/windows-installer-script-e2e.ps1 b/tests/install/windows-installer-script-e2e.ps1
index c9cd906eb03..58a8d8944af 100644
--- a/tests/install/windows-installer-script-e2e.ps1
+++ b/tests/install/windows-installer-script-e2e.ps1
@@ -54,6 +54,14 @@ function Fail([string]$Message) {
Write-Host "E2E ASSERTION FAILED: $Message" -ForegroundColor Red
exit 1
}
+# Full transcript in the job log, collapsed (GitHub renders ::group:: as a
+# fold). Win or lose -- a green install's log is how you diagnose the leg
+# that fails next.
+function Write-LogGroup([string]$Title, [string]$LogPath) {
+ Write-Host "::group::$Title"
+ if (Test-Path -LiteralPath $LogPath) { Get-Content -LiteralPath $LogPath | Write-Host }
+ Write-Host "::endgroup::"
+}
function Invoke-Git {
param([string[]]$GitArgs)
@@ -134,9 +142,9 @@ function Invoke-Installer {
& powershell -NoProfile -ExecutionPolicy Bypass -File $script @flags *> $log
$installExit = $LASTEXITCODE
$ErrorActionPreference = $prevEap
+ Write-LogGroup "install.ps1 ($Label) transcript" $log
if ($installExit -ne 0) {
- Get-Content -LiteralPath $log -Tail 50 | Write-Host
- Fail "install.ps1 ($Label) exited $installExit; full log in $log"
+ Fail "install.ps1 ($Label) exited $installExit; transcript above, log at $log"
}
}
@@ -190,9 +198,9 @@ switch ($UpdateMethod) {
Pop-Location
$ErrorActionPreference = $prevEap
}
+ Write-LogGroup "hermes update transcript" $log
if ($updateExit -ne 0) {
- Get-Content -LiteralPath $log -Tail 50 | Write-Host
- Fail "hermes update exited $updateExit; full log in $log"
+ Fail "hermes update exited $updateExit; transcript above, log at $log"
}
}
"installer-script" {