test: own temporary directories through createTestTempDirectory in remaining tests/ (#12727)

* test: own temporary directories through createTestTempDirectory in remaining tests/

Give per-test directories in the remaining tests/ suites to
createTestTempDirectory so onTestFinished removes them through
removeTestWorkspace. Keep suite-scoped roots and child-process directories
whose removal is the assertion.

* test: drop empty cleanup callbacks and keep the capture skip reason visible

Remove the no-op withVerifierCleanup steps left after directory removal
moved to createTestTempDirectory. Put the native capture skip explanation
in the Linux sample test name, because it.skipIf only tests truthiness.

Co-authored-by: morluto <morluto@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-11-19 23:22:53 -05:00
1 parent e58c60b36e
commit 385e5d228f
46 files changed
+1487 -1738

No files matched your search

@@ -13,7 +13,10 @@ import {
import { parseProcessCapture } from "../../../src/domain/process/processCaptureParsing.js";
import { compareProcessCaptures } from "../../../src/domain/process/processComparison.js";
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
import { itWithCaptureCapability } from "./processCaptureCapability.js";
import {
CAPTURE_SKIP_REASON,
itWithCaptureCapability,
} from "./processCaptureCapability.js";
const processFixture = fileURLToPath(
new URL("../../fixtures/processIdentity.mjs", import.meta.url),
@@ -25,8 +28,8 @@ const identitySchema = z.object({
session_id: z.number().int().positive(),
});
const itWithLinuxCaptureCapability =
process.platform === "linux" ? itWithCaptureCapability : it.skip;
const linuxCaptureSkip =
process.platform !== "linux" || CAPTURE_SKIP_REASON !== false;
itWithCaptureCapability(
"captures a POSIX PATH executable with a literal backslash in its basename",
@@ -180,8 +183,10 @@ itWithCaptureCapability.each([
20_000,
);
itWithLinuxCaptureCapability.each([false, true])(
"honors pids=%s in owned Linux capture samples and committed Evidence",
it.skipIf(linuxCaptureSkip).each([false, true])(
linuxCaptureSkip && CAPTURE_SKIP_REASON !== false
? `honors pids=%s in owned Linux capture samples and committed Evidence — ${CAPTURE_SKIP_REASON}`
: "honors pids=%s in owned Linux capture samples and committed Evidence",
async (pids) => {
const root = await createTestTempDirectory("rea-process-identifiers-");
const identityPath = join(root, "identity.json");