test: remove stale limits and handoff expectations

This commit is contained in:
morluto
2026-09-29 17:00:16 +08:00
parent ecf3ed8bdb
commit acf33d6df2
22 changed files with 206 additions and 156 deletions
@@ -43,30 +43,6 @@ describe("runtime executable diagnostics", () => {
expect(pathNodes.every(({ healthy }) => healthy)).toBe(true);
});
it("reports every PATH candidate beyond the former per-tool cap", async () => {
const directories = await Promise.all(
Array.from({ length: 17 }, () => temporaryRoot()),
);
await Promise.all(
directories.map((directory) =>
symlink(process.execPath, join(directory, "node")),
),
);
const inventory = await inspectRuntimeExecutables({
platform: process.platform,
path: directories.join(delimiter),
launcherNode: process.execPath,
});
expect(
inventory.candidates.filter(
({ tool, path_index: pathIndex }) =>
tool === "node" && pathIndex !== null,
),
).toHaveLength(17);
});
it("distinguishes a healthy primary runtime from a broken shadowed candidate", async () => {
const healthy = await temporaryRoot();
const broken = await temporaryRoot();
@@ -169,6 +145,51 @@ describe("runtime executable diagnostics", () => {
});
});
describe("complete runtime diagnostics", () => {
it("reports every PATH candidate", async () => {
const directories = await Promise.all(
Array.from({ length: 17 }, () => temporaryRoot()),
);
await Promise.all(
directories.map((directory) =>
symlink(process.execPath, join(directory, "node")),
),
);
const inventory = await inspectRuntimeExecutables({
platform: process.platform,
path: directories.join(delimiter),
launcherNode: process.execPath,
});
expect(
inventory.candidates.filter(
({ tool, path_index: pathIndex }) =>
tool === "node" && pathIndex !== null,
),
).toHaveLength(17);
});
it("preserves complete diagnostics", async () => {
const root = await temporaryRoot();
await executable(
join(root, "node"),
"#!/bin/sh\nprintf '%070000d' 0 >&2\nexit 17\n",
);
const inventory = await inspectRuntimeExecutables({
platform: process.platform,
path: root,
launcherNode: process.execPath,
});
const candidate = inventory.candidates.find(
({ tool, path_index: pathIndex }) => tool === "node" && pathIndex === 0,
);
expect(candidate?.failure?.stderr).toHaveLength(70_000);
});
});
const temporaryRoot = async (): Promise<string> => {
const root = await createTestTempDirectory("rea-runtime-diagnostics-");
roots.push(root);