refactor: dedupe test and runtime seams

This commit is contained in:
Peter Steinberger
2026-03-24 23:32:41 +00:00
parent 369119b6b5
commit 6f6468027a
88 changed files with 2601 additions and 3811 deletions

View File

@@ -1,3 +1,5 @@
import { execFileSync } from "node:child_process";
import path from "node:path";
import { describe, expect, it } from "vitest";
import {
parseCompletedTestFileLines,
@@ -108,3 +110,37 @@ describe("scripts/test-parallel memory trace parsing", () => {
});
});
});
describe("scripts/test-parallel lane planning", () => {
it("keeps serial profile on split unit lanes instead of one giant unit worker", () => {
const repoRoot = path.resolve(import.meta.dirname, "../..");
const output = execFileSync("node", ["scripts/test-parallel.mjs"], {
cwd: repoRoot,
env: {
...process.env,
OPENCLAW_TEST_LIST_LANES: "1",
OPENCLAW_TEST_PROFILE: "serial",
},
encoding: "utf8",
});
expect(output).toContain("unit-fast");
expect(output).not.toContain("unit filters=all maxWorkers=1");
});
it("recycles default local unit-fast runs into bounded batches", () => {
const repoRoot = path.resolve(import.meta.dirname, "../..");
const output = execFileSync("node", ["scripts/test-parallel.mjs"], {
cwd: repoRoot,
env: {
...process.env,
CI: "",
OPENCLAW_TEST_LIST_LANES: "1",
},
encoding: "utf8",
});
expect(output).toContain("unit-fast-batch-");
expect(output).not.toContain("unit-fast filters=all maxWorkers=");
});
});