test(process): check malformed capture choices concurrently

The malformed process-choice acceptance test spawned 26 CLI processes one
after another. On CI it took 45-59 s against its 60 s deadline and timed
out on unrelated PRs. Run the independent cases concurrently, each with
its own scenario file; every assertion is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-09 14:17:27 +00:00
co-authored by Claude Opus 5.5
parent b80bd2db96
commit 48de11ce2e
@@ -161,21 +161,26 @@ captureTest(
}), }),
), ),
]; ];
for (const options of invalid) { // Each CLI case is an independent process; running them concurrently keeps
const request = { ...scenario, ...options }; // the suite well inside its deadline on slower CI runners.
expect( await Promise.all(
(await call("capture_process_scenario", request)).isError, invalid.map(async (options, index) => {
JSON.stringify(options), const request = { ...scenario, ...options };
).toBe(true); expect(
const path = join(root, "scenario.json"); (await call("capture_process_scenario", request)).isError,
await writeFile(path, JSON.stringify(request)); JSON.stringify(options),
await expect( ).toBe(true);
execute(process.execPath, [cli, "capture-process", path, "--json"]), const path = join(root, `scenario-${String(index)}.json`);
).rejects.toMatchObject({ await writeFile(path, JSON.stringify(request));
code: 1, await expect(
stdout: expect.stringContaining("invalid_request"), execute(process.execPath, [cli, "capture-process", path, "--json"]),
}); JSON.stringify(options),
} ).rejects.toMatchObject({
code: 1,
stdout: expect.stringContaining("invalid_request"),
});
}),
);
await expect(access(marker)).rejects.toMatchObject({ code: "ENOENT" }); await expect(access(marker)).rejects.toMatchObject({ code: "ENOENT" });
const missing = join(root, "missing-executable"); const missing = join(root, "missing-executable");
const failed = await call("capture_process_scenario", { const failed = await call("capture_process_scenario", {