Repository navigation
refactor(qa): share CLI test temporary workspace cleanup - #118496
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 11:42 AM ET / 15:42 UTC (Revision 8). ClawSweeper reviewWhat this changesQA Lab’s CLI runtime tests create temporary directories through the existing workspace helper and clean them up after each test. Merge readiness✅ Ready for maintainer review Current main and the latest release still contain the direct fixture cleanup this PR addresses. The focused patch has no identified correctness or security blocker; its maintainer label also rules out automatic closure. Priority: P3 Review scores
Verification
How this fits togetherQA Lab’s CLI runtime tests call plugin commands using temporary fixture directories and mocked external runners. The commands write reports and summaries that the tests inspect before teardown. flowchart LR
A[Test cases] --> B[Temporary workspace helper]
B --> C[QA CLI commands]
C --> D[Report and summary files]
D --> E[Assertions]
E --> F[After-test cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -10. Total -10 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep QA Lab fixture ownership in its established helper while preserving the CLI suite’s assertions and exit-code restoration. Do we have a high-confidence way to reproduce the issue? Not applicable: this is test-fixture cleanup. Current-main source confirms that the direct directory lifecycle sites remain. Is this the best way to solve the issue? Yes. The patch reuses the established QA Lab workspace helper without changing the CLI scenarios or their assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5c13ecfcbf19. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
Merged via squash.
|
* commit '9a1a6f7db9783d0b8abaf918bfe12978ea745b57': (26 commits) fix(maintainer): restore cold PR worktree provisioning (#157394) feat(ios): establish native Cloudflare Access sign-in sessions (#146996) fix: restore the Gateway after interrupted Doctor maintenance (#156854) refactor(line): retire the Express webhook adapter (#157369) refactor(cron): consolidate unavailable delivery targets (#157393) ci: apply Go memory defaults to architecture checks fix(cli): preserve the first PowerShell completion test failure (#157267) refactor(agents): consolidate transcript-tail model selection (#157382) fix(release): honor frozen validation contracts (#157034) fix(perf): use settled Kova terminal CPU accounting (#157029) chore(windows): verify packaged repair worker lifecycle (#157047) refactor(logging): share memory pressure threshold selection (#157164) fix(release): verify bundled fs-safe native bindings (#157027) perf(skills): skip warm prompt search when minimum cannot fit (#157343) fix(ui): avoid retaining detached tooltip anchors (#157226) perf(ci): reuse compiler state and shorten guard and UI tests (#157265) perf(ui): preserve model caches on unrelated metadata updates (#157254) chore: remove the tracked PR-body artifact and ignore .artifacts (#157296) refactor: consolidate duplicate MCP lifecycle tests (#157360) test(qa): consolidate CLI runtime fixtures (#118496) ...
What Problem This Solves
The QA CLI runtime tests still manage nine temporary-directory lifecycles directly, duplicating the workspace owner already used by neighboring QA Lab tests.
User Impact
No product behavior changes. Fixture directories use the existing QA Lab cleanup owner, reducing repeated teardown code and retaining ownership when fixture construction or assertions fail. No performance improvement is claimed.
Why This Change Was Made
Move the remaining creation sites to
createTempDirHarnessand await cleanup in the existing teardown after restoring spies and environment state. Keep the deliberate summary-file deletion, every assertion and scenario payload, current summary/parity helpers, and all 21 Bun-safe exit-code restorations. This is the useful remainder of the original PR; main has already absorbed its broader fixture consolidation.Evidence
priorExitCode ?? 0restorations, and nine fixture prefixes.25c6031281b93ba350d14ac7f1effc684e55c58d/ treeebeba84d5dbe87be7f5fcf387125569364f68b06. The complete file passed 163/163 on Node 24.19.0 and 163/163 on the repository-pinned Bun fork, with matching case inventories and zero skips. Both pinned Bun archive/executable checksums passed.--maxWorkers=1: Node 53.49s; Bun 42.78s. Actual file test time was 5.011s / 4.718s; cold transforms and imports account for the longer walls. This existing suite covers real CLI calls, filesystem reports and error handling with mocked external execution. No cases or per-test process boots were added, and these measurements are validation cost, not a performance comparison.The existing Bun pin emitted a directory-mismatch diagnostic after the test summary. Inspection of the exact pinned resolver and the unchanged absolute
--tsconfig-overridecaller shows it logs this after a successful absolute-path fallback. The warning is retained and no runtime-version change or clean-runtime claim is made here.The local disk-usage observer reported an allocation-measurement error near final staging cleanup, so its controller result remains failed. The native validation itself exited 0; separately downloaded JSON reports, check logs and unchanged source verify the passing tests/checks. Staging removal was confirmed. The observer error was not hidden or used to rerun tests.
Exact-head PR CI passed (37 successful jobs; 20 scope-appropriate skips). The changed-file job ran all 163 cases; its reported individual case times sum to 5.886 seconds. CI did not emit a file-duration row, so that sum is not a suite or command wall time. Fresh automated review completed on this head with no actionable findings. Its reviewer could not access the separately downloaded Testbox reports; the maintainer inspected those reports and raw check logs. The Testbox lease job was stopped after collection, and ordinary exact-head CI independently passed.