Files
reverse-engineering-anything/tests/boundary/process/nativeVerifierCleanup.test.ts
T
morlutoandCursor Agent b00138be64 fix(verification): retain failed cleanup owners and primary errors (#9993)
* fix(verifiers): retain native cleanup ownership on failure

* fix(verification): load cleanup fixtures through the module resolver

CodeQL's local threat model treats file contents passed to
vm.SourceTextModule as user-controlled code execution. Import the real
verifier modules and redirect their dependencies to static mocks instead
of compiling script text read from disk.

* fix(verifiers): own CLI and MCP process families

* fix(verifiers): retire workspaces after cleanup retry

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-11-11 17:39:19 +08:00

37 lines
1.1 KiB
TypeScript

import { fileURLToPath } from "node:url";
import { expect } from "vitest";
import { processTest } from "../../support/process/processFixture.js";
processTest.for(["none", "client", "transport", "both", "early"])(
"preserves native verifier failure and cleanup ownership (fault: $0)",
async (fault, { processes }) => {
const result = await processes.run(process.execPath, [
fileURLToPath(
new URL(
"../../fixtures/nativeValueVerifierCleanup.mjs",
import.meta.url,
),
),
fault,
]);
expect(result.exitCode, result.stderr).toBe(0);
expect(JSON.parse(result.stdout)).toMatchObject({
fault,
primaryPreserved: true,
});
},
);
processTest(
"finishes IDA verifier cleanup without replacing the analysis failure",
async ({ processes }) => {
const result = await processes.run(process.execPath, [
fileURLToPath(
new URL("../../fixtures/idaVerifierCleanup.mjs", import.meta.url),
),
]);
expect(result.exitCode, result.stderr).toBe(0);
expect(result.stdout.trim().split("\n")).toHaveLength(2);
},
);