Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

test(process): serialize real CLI capture boundaries

morluto82560ebf593a
diff --git a/docs/testing.md b/docs/testing.md
index 8fc433de5..3db5623b3 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -469,7 +469,9 @@ provider evidence.
Each Vitest project uses up to two workers, bounded by available host parallelism.
Default-group projects can run together. Only `process-boundary` runs in the
later sequence group and serializes its files because process-tree observations
-share host sampling resources. Acceptance and process-global files retain isolated
+share host sampling resources. Tests that launch the real process harness belong
+in `tests/boundary/process/`, including CLI command and environment tests.
+Acceptance and process-global files retain isolated
forks but are not serialized; isolation does not imply serial scheduling. CI uses
the same per-project worker bound.
The pure domain/contracts and recording-port service projects share one worker
diff --git a/src/cliEnvironmentSeam.test.ts b/tests/boundary/process/cliEnvironmentSeam.test.ts
similarity index 78%
rename from src/cliEnvironmentSeam.test.ts
rename to tests/boundary/process/cliEnvironmentSeam.test.ts
index 6ad300860..5404b3422 100644
--- a/src/cliEnvironmentSeam.test.ts
+++ b/tests/boundary/process/cliEnvironmentSeam.test.ts
@@ -4,11 +4,14 @@ import { join } from "node:path";
import { describe, expect, it } from "vitest";
-import { captureProcessScenarioFile } from "./application/process/ProcessCli.js";
-import { runCapabilityStatus } from "./composition/directAnalysis.js";
-import { probeProcessCaptureCapability } from "./process/capture/ProcessHarness.js";
-import { parseEvidence } from "./domain/evidence.js";
-import { parseProcessCapture } from "./domain/process/processCapture.js";
+import {
+ captureProcessScenarioFile,
+ isProcessCliFailure,
+} from "../../../src/application/process/ProcessCli.js";
+import { runCapabilityStatus } from "../../../src/composition/directAnalysis.js";
+import { probeProcessCaptureCapability } from "../../../src/process/capture/ProcessHarness.js";
+import { parseEvidence } from "../../../src/domain/evidence.js";
+import { parseProcessCapture } from "../../../src/domain/process/processCapture.js";
describe("the CLI takes its environment as an input", () => {
it("resolves from injected PATH and inherits injected env with scenario overrides", async ({
@@ -48,6 +51,10 @@ describe("the CLI takes its environment as an input", () => {
REA_CAPTURE_INJECTED_MARKER: "injected-value",
REA_CAPTURE_SCENARIO_OVERRIDE: "host-value",
});
+ if (isProcessCliFailure(result))
+ throw new Error(
+ `Process capture returned an error: ${JSON.stringify(result)}`,
+ );
const evidence = parseEvidence(result);
const capture = parseProcessCapture(evidence.normalized_result);
expect(capture.frames.map(({ data }) => data).join("")).toContain(
diff --git a/tests/boundary/cli/processCli.test.ts b/tests/boundary/process/processCli.test.ts
similarity index 100%
rename from tests/boundary/cli/processCli.test.ts
rename to tests/boundary/process/processCli.test.ts