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 <morluto@users.noreply.github.com>
This commit is contained in:
Cursor Agentandmorluto committed 2026-10-22 18:51:11 +00:00
1 parent 3140f8c002
commit a6380ee11f
2 files changed
+28 -9

No files matched your search

+9 -5
View File
@@ -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({
@@ -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;