Skip to content

The agent that grows with you

fix(windows-e2e): 'auto' sentinel for install-ref - powershell -File eats empty-string args

ethernete8bdb6933e61
diff --git a/.github/workflows/install-e2e-windows-run.yml b/.github/workflows/install-e2e-windows-run.yml
index 8a8ac84790a..7816c14270c 100644
--- a/.github/workflows/install-e2e-windows-run.yml
+++ b/.github/workflows/install-e2e-windows-run.yml
@@ -41,10 +41,10 @@ on:
type: string
default: desktop
install-ref:
- description: 'Ref to install as OLD (served as main while the installer runs). Empty = the newest release tag in the checkout.'
+ description: 'Ref to install as OLD (served as main while the installer runs). auto = the newest release tag in the checkout.'
required: false
type: string
- default: ''
+ default: auto
setup-exe-url:
description: 'Bootstrap installer to install OLD with. Default: the latest published one — what a user downloads today.'
required: false
diff --git a/tests/install/windows-desktop-gui-e2e.ps1 b/tests/install/windows-desktop-gui-e2e.ps1
index ef4b5ee1f69..e5f950233a0 100644
--- a/tests/install/windows-desktop-gui-e2e.ps1
+++ b/tests/install/windows-desktop-gui-e2e.ps1
@@ -82,10 +82,12 @@ param(
# i.e. what the user starts on. The published Hermes-Setup.exe carries
# no commit pin (Pin { commit: None, branch: "main" }) -- it installs
# whatever `main` points at, so staging OLD means serving it there.
- # Empty = newest release tag in the checkout (the "user on the current
- # release" starting point, same philosophy as the linux axis's tag
- # matrix).
- [string]$InstallRef = "",
+ # Empty or "auto" = newest release tag in the checkout (the "user on
+ # the current release" starting point, same philosophy as the linux
+ # axis's tag matrix). "auto" exists because `powershell -File` silently
+ # swallows an empty-string argument ('Missing an argument for
+ # parameter'), so the workflow cannot pass "".
+ [string]$InstallRef = "auto",
# Repo checkout whose HEAD is the update target.
[string]$RepoRoot = "",
@@ -301,7 +303,7 @@ function Invoke-PhaseStage {
# OLD: explicit -InstallRef, or the newest release tag -- the version a
# user who installed on release day is on.
$oldRef = $InstallRef
- if (-not $oldRef) {
+ if (-not $oldRef -or $oldRef -eq "auto") {
$oldRef = (Invoke-Git @("-C", $RepoRoot, "tag", "--list", "v*", "--sort=-creatordate") -split "`r?`n" | Select-Object -First 1)
if (-not $oldRef) { throw "no v* release tags in the checkout and no -InstallRef given -- cannot pick an OLD version" }
}