From a6380ee11f90a508b425f23b5aa84b478698af05 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 22 Oct 2026 18:51:11 +0000 Subject: [PATCH] fix(hopper): pass the host distribution into install-host tests #3422 requires systemLinuxHopperInstallHost to take the caller's distribution reader. These launcher and package tests still called the old one-argument form, so typecheck failed on main. Co-authored-by: morluto --- src/application/LinuxHopper.test.ts | 14 +++++++---- .../LinuxHopperPackageRuntime.test.ts | 23 +++++++++++++++---- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/application/LinuxHopper.test.ts b/src/application/LinuxHopper.test.ts index 7a2838e86e..929be58da9 100644 --- a/src/application/LinuxHopper.test.ts +++ b/src/application/LinuxHopper.test.ts @@ -9,6 +9,7 @@ import { linuxPackageManagerCommands, linuxSharedLibrariesAvailable, parseLinuxDistribution, + readLinuxDistribution, supportsReaHost, LinuxHopperTemporaryCleanupOwner, systemLinuxHopperInstallHost, @@ -379,11 +380,14 @@ describe("Linux Hopper cleanup and failure details", () => { const directory = await createTestTempDirectory("rea-hopper-status-"); const launcher = join(directory, "Hopper"); await writeFile(launcher, "fixture launcher"); - const host = systemLinuxHopperInstallHost({ - ...process.env, - HOME: directory, - XDG_CACHE_HOME: join(directory, "cache"), - }); + const host = systemLinuxHopperInstallHost( + { + ...process.env, + HOME: directory, + XDG_CACHE_HOME: join(directory, "cache"), + }, + () => readLinuxDistribution(process.arch), + ); const command = vi .spyOn(nativeCommands, "execFileOutput") .mockResolvedValue({ diff --git a/src/application/LinuxHopperPackageRuntime.test.ts b/src/application/LinuxHopperPackageRuntime.test.ts index 1acd97b6bd..34bdf1eca8 100644 --- a/src/application/LinuxHopperPackageRuntime.test.ts +++ b/src/application/LinuxHopperPackageRuntime.test.ts @@ -6,9 +6,12 @@ import { err, ok } from "../domain/result.js"; import * as pythonRuntime from "./LinuxHopperPython.js"; import { linuxHopperInstallDisclosure, + readLinuxDistribution, systemLinuxHopperInstallHost, } from "./LinuxHopper.js"; +const hostDistribution = () => readLinuxDistribution(process.arch); + const missingPython = { interpreter: "/usr/bin/python3", version: [3, 14], @@ -80,7 +83,10 @@ describe("Linux Hopper package runtime", () => { const directory = await createTestTempDirectory( "rea-linux-python-install-", ); - const host = systemLinuxHopperInstallHost({ XDG_CACHE_HOME: directory }); + const host = systemLinuxHopperInstallHost( + { XDG_CACHE_HOME: directory }, + hostDistribution, + ); const command = vi .spyOn(boundedCommands, "execFileBoundedOutput") .mockResolvedValue(commandSuccess); @@ -115,7 +121,10 @@ describe("Linux Hopper package runtime", () => { const directory = await createTestTempDirectory( "rea-linux-python-failure-", ); - const host = systemLinuxHopperInstallHost({ XDG_CACHE_HOME: directory }); + const host = systemLinuxHopperInstallHost( + { XDG_CACHE_HOME: directory }, + hostDistribution, + ); const failed = { exitCode: 67, stdout: "original package output", @@ -153,7 +162,10 @@ describe("Linux Hopper package mapping", () => { "/usr/lib/x86_64-linux-gnu/libpython3.13.so.1.0", ])("keeps an unproven APT mapping unknown: %s", async (path) => { const directory = await createTestTempDirectory("rea-python-package-map-"); - const host = systemLinuxHopperInstallHost({ XDG_CACHE_HOME: directory }); + const host = systemLinuxHopperInstallHost( + { XDG_CACHE_HOME: directory }, + hostDistribution, + ); const command = vi .spyOn(boundedCommands, "execFileBoundedOutput") .mockResolvedValue(commandSuccess); @@ -201,7 +213,10 @@ describe("Linux Hopper package cancellation and disclosure", () => { const directory = await createTestTempDirectory( "rea-python-install-cancel-", ); - const host = systemLinuxHopperInstallHost({ XDG_CACHE_HOME: directory }); + const host = systemLinuxHopperInstallHost( + { XDG_CACHE_HOME: directory }, + hostDistribution, + ); const controller = new AbortController(); const cause = new Error("caller cancelled at " + phase); let commandCount = 0;