Repository navigation
test(providers): own temporary directories through createTestTempDirectory - #12722
Conversation
…ctory Route provider-boundary fixtures through createTestTempDirectory so each case removes its canonical directory after the test. Process shutdown stays in afterEach, which still runs before that removal. Skip the two Windows Cutter checks with it.skipIf, and compare unknown plugin recovery with cutterBridgeSourceRecovery.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Low impact] The reviewed changes appear safe to merge. SummaryProvider tests now use
Reviews (3) · Last reviewed commit: "test(cutter): keep an independent unknow..." · Reviewed by Greptile |
createTestTempDirectory always deletes after the test, including when GDB or inferior cleanup fails and when the Rizin MCP harness already owns the directory. Restore mkdtemp removal behind confirmed process cleanup, and leave decoder inputs owned by the harness. Co-authored-by: morluto <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eecc3dd83e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Comparing discovery recovery with cutterBridgeSourceRecovery follows the formatter, so dropping the unknown-source explanation still passes. Assert that explanation directly, beside bridge_source and the plugin path. Co-authored-by: morluto <[email protected]>
…-admission Resolve conflicts with upstream/main (8fefe18): - Remove docs/specs/README.md and docs/specs/native/macho-dsym-companion/* per morluto#12856 - Combine caller_input_path and debug_companion in liveBinaryTargetSummary.ts - Combine ComLoader import and debug_companion in GhidraAnalysisProfile.ts - Combine detectDatabaseEngine, boolean hasTrailingZipArchive, and retainTargetCancellation (morluto#12339) with dsym_path admission and cleanup in BinaryTargetResolver.ts - Update advertised schema summary for open_binary.json - Migrate new tests in ghidraCheckpointLifecycle.test.ts and GhidraProvider.behavior.test.ts to createTestTempDirectory (morluto#12722)
…xture changes RizinInferiorTty now imports tests/fixtures/temporaryDirectory.ts from main (morluto#12722), so the workflow's direct-import path list names it too.
Summary
Provider-boundary tests created temporary directories with
mkdtemp(join(tmpdir(), …))and deleted them by hand. Those directories now come fromcreateTestTempDirectory, which returns the canonical path and removes it inonTestFinishedafterafterEach. Two Cutter tests that returned early on Windows are skipped withit.skipIf. Unknown plugin recovery is checked for the explanationsource is unknown, independently of the formatter.Directories whose removal was withheld until process cleanup succeeded stay on
mkdtempand are removed only by that owner. The Rizin decoder directory stays owned bycreateProviderEnvironmentMcpHarness.Problem and expected behavior
Manual
mkdtempcleanup can leak an owned directory when a test fails before itsrm, and a barereturnon Windows made two Cutter tests pass without running. Each case should own one canonical directory that is removed after process shutdown, and Windows-inapplicable checks should be reported as skipped. A directory that is kept when process cleanup fails, or that another helper already deletes, must keep that single owner.Change and scope
mkdtemp/mkdtempSyncsites in 25 files undertests/boundary/providersnow callcreateTestTempDirectory, except the leave-alones below. Matching manualrm,rmSync, andonTestFinisheddirectory deletion was removed where the helper took ownership.afterEachstill closes sessions, managers, and inferior processes before that removal, because Vitest runsafterEachbeforeonTestFinished.Left alone:
tests/boundary/providers/ida/verifierObservations.test.ts:151removes its directory only when owned-command cleanup is confirmed. Unconfirmed cleanup retains the workspace.GdbSessionManagers.test.ts,GdbSessionReviewRegressions.test.ts, andGdbSessionManagerCoverage.test.tsremove the directory insidefixtureOwner.cleanup, which throws beforeremoveFilesif a child has not exited.GdbCommandQueue.test.tsandRizinInferiorExit.test.tsremove the directory only after close or stop succeeds. A failure throws first and retains the directory.RizinDecoderInputs.test.tscreates the directory withmkdtemp.createProviderEnvironmentMcpHarnessis the only deleter.Assertion replacement:
CutterBridgeClient.test.tsasserts that unknown recovery containssource is unknown, not the return value ofcutterBridgeSourceRecovery. The case also assertsbridge_source: "unknown"and that the recovery contains the packaged plugin path. A connective wording change that keeps the phrase still passes. Removing the phrase fails both unknown cases.npm run test:localrefuses these paths because they belong to a built boundary project.npm run test:focusedis the command that runs them.Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
it.skipIf(process.platform === "win32")instead of returning before any assertion.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
returncounts as a pass. Comparing recovery withcutterBridgeSourceRecovery("unknown")follows the formatter, so deleting the unknown-source explanation from that function still passes.toContain("source is unknown")fails when that phrase is removed.RizinDecoderInputs.test.tsskipped all 6 tests because no Rizin binary is on PATH. Real Ghidra, Hopper, and IDA lanes were not run; these are fixture tests.For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
Not a boundary or lifecycle production fix. Fixture directories that the helper owns are removed after the existing process shutdown in
afterEach. Directories gated on confirmed process cleanup stay with that owner.For evidence-bearing changes:
Validation performed
Node.js 24.22.1. Head:
b3926d692.npm run test:focused --the 25 files — two full runs before the ownership fix: 497 passed, 8 skipped (24 files passed,RizinDecoderInputs.test.tsskipped).npm run verify:test-temp-hygiene --those 25 files — "no owned residues remain" (497 passed, 8 skipped).npm run test:focused --the six files restored to gatedmkdtempcleanup — two passes: 249 passed, 6 skipped (RizinDecoderInputs.test.ts).npm run test:focused -- tests/boundary/providers/CutterBridgeClient.test.ts— 40 passed after restoringtoContain("source is unknown").npm run check:fast— typecheck, lint, and architecture guards passed on the earlier commits. The pre-push hook ran it on the first push.git diff --check— clean.npm run test:local --these files exits before running them and tells the caller to usetest:focused.Compatibility, safety, and release
RizinDecoderInputs.test.ts.Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.