mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
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:
2 files changed
+28
-9
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user