test: align planner explain output with execution

This commit is contained in:
Tak Hoffman
2026-03-25 15:17:06 -05:00
parent de5e46f9b0
commit 5598f6bd83
3 changed files with 74 additions and 30 deletions

View File

@@ -248,6 +248,18 @@ describe("scripts/test-parallel lane planning", () => {
).toThrowError(/Unsupported test profile "macmini"/u);
});
it("rejects unknown explicit surface names", () => {
const repoRoot = path.resolve(import.meta.dirname, "../..");
expect(() =>
execFileSync("node", ["scripts/test-parallel.mjs", "--plan", "--surface", "channel"], {
cwd: repoRoot,
env: process.env,
encoding: "utf8",
}),
).toThrowError(/Unsupported --surface value\(s\): channel/u);
});
it("rejects wrapper --files values that look like options", () => {
const repoRoot = path.resolve(import.meta.dirname, "../..");

View File

@@ -110,4 +110,21 @@ describe("test planner", () => {
expect(explanation.reasons).toContain("base-pinned-manifest");
expect(explanation.intentProfile).toBe("normal");
});
it("uses hotspot-backed memory isolation when explaining unit tests", () => {
const explanation = explainExecutionTarget(
{
mode: "local",
fileFilters: ["src/infra/outbound/targets.channel-resolution.test.ts"],
},
{
env: {
OPENCLAW_TEST_LOAD_AWARE: "0",
},
},
);
expect(explanation.isolate).toBe(true);
expect(explanation.reasons).toContain("unit-memory-isolated");
});
});