Skip to content

Fix upgrade tests when the LKG release has multiple installers - #2097

Merged
tyrielv merged 2 commits into
microsoft:masterfrom
tyrielv:tyrielv/fix-upgrade-lkg-arm64
Aug 27, 2026
Merged

Fix upgrade tests when the LKG release has multiple installers#2097
tyrielv merged 2 commits into
microsoft:masterfrom
tyrielv:tyrielv/fix-upgrade-lkg-arm64

Conversation

@tyrielv

@tyrielv tyrielv commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Problem

The staging-upgrade upgrade test (and every scenario in upgrade-tests.yaml) failed with:

Start-Process: Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'FilePath'.

The job picks the last-known-good installer with:

$lkgInstaller = (Get-ChildItem gvfs-lkg\SetupGVFS*.exe).FullName

Now that releases publish both an x64 and an arm64 installer (SetupGVFS.<version>.exe and SetupGVFS.<version>-arm64.exe), the glob matches two files, so .FullName returns an array. Start-Process -FilePath then rejects the array.

Fix

Select the x64 installer explicitly. The x64 installer has no architecture suffix; the arm64 one ends in -arm64.exe. The upgrade tests run on an x64 runner and download the x64 "new" installer, so the x64 LKG installer is the correct match.

  • Filter out the arm64 installer and take the first match for both the LKG and the "new" installer selection.
  • Throw a clear error if no x64 installer is found, instead of failing later inside Start-Process.

Testing

  • Verified the PowerShell snippet parses with no errors.
  • Verified the regex keeps SetupGVFS.2.0.26229.1.exe and drops SetupGVFS.2.0.26229.1-arm64.exe.

The upgrade test job selected the last-known-good installer with
`(Get-ChildItem gvfs-lkg\SetupGVFS*.exe).FullName`. Releases now publish
both an x64 and an arm64 installer, so the glob matches two files and
`.FullName` returns an array. `Start-Process -FilePath` then fails with
"Cannot convert 'System.Object[]' to the type 'System.String'".

Select the x64 installer explicitly. The x64 installer has no
architecture suffix; the arm64 one is named `SetupGVFS.<version>-arm64.exe`.
These tests run on an x64 runner and download the x64 "new" installer, so
the x64 LKG installer is the correct match. Apply the same guard to the
"new" installer selection and throw a clear error if no x64 installer is
present.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
@tyrielv
tyrielv marked this pull request as ready for review August 26, 2026 21:06
@tyrielv
tyrielv enabled auto-merge August 26, 2026 21:06
Address self-review feedback on the multi-installer fix. Replace the
`-arm64` denylist plus `Select-Object -First 1` with a shared
`Select-X64Installer` helper that positively matches the x64 asset by its
suffix-less name (`SetupGVFS.<version>.exe`) and requires exactly one match.

The denylist would still pass a future non-x64 asset (for example a `-x86`
or `-arm` installer) and `-First 1` would then pick an arbitrary file. The
positive allowlist matches the documented x64 naming contract and fails
loudly when the directory holds an unexpected number of installers. The
helper also removes the duplicated filter across the LKG and new installer
selection, and its error message reports the directory and the files found.

Note in a comment that arm64 upgrade is not exercised here because the
runner is x64.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
@tyrielv
tyrielv merged commit 0de158e into microsoft:master Aug 27, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants