Repository navigation
fix(test): keep complete multi-project JSON reports - #133309
Conversation
Preserve per-attempt native JSON, blob and coverage evidence across project and plugin-batch processes. Merge accepted disjoint case inventories through Vitest, retain originals and actual outcomes, and keep metadata child-owned. Fixes #133305.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 11:10 AM ET / 15:10 UTC. ClawSweeper reviewWhat this changesThe branch gives supported multi-process Vitest runs isolated child report artifacts and publishes a validated native JSON aggregate while retaining the original reports. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessNo introduced correctness defect was found in the reviewed head. This maintainer-authored, protected PR remains open pending exact-head automation and maintainer acceptance; the prior fixture bootstrap blocker was addressed in the second commit. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw test schedulers split selected projects and plugin tests into separate native Vitest processes. The new report owner sits between those schedulers and Vitest, capturing each child’s artifacts before validating and publishing one aggregate file. flowchart LR
A[Test command] --> B[Project or plugin scheduler]
B --> C[Native Vitest children]
C --> D[Per-attempt JSON and blob files]
D --> E[Report owner validation]
E --> F[Native Vitest merge]
F --> G[Published JSON report]
D --> H[Retained originals and index]
Decision needed
Why: The protected maintainer label requires explicit maintainer handling, and a stale test merge cannot substitute for current-head CI and merge validation. Before merge
Agent review detailsSecurityNone. PR surfaceTests +686, Docs +48, Other +732. Total +1466 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one report owner at the two existing scheduler boundaries, then land only after the current head passes its relevant CI shards and the merge result is refreshed against current main. Do we have a high-confidence way to reproduce the issue? Yes. The submitted fixture defines two native child configurations and asserts the aggregate inventory, with a pre-fix five-versus-three-case scenario described in the linked issue and PR evidence. Is this the best way to solve the issue? Yes, subject to current-head CI. A shared owner at the existing cross-process schedulers addresses the overwrite at its producer boundary without replacing process isolation or hand-writing Vitest report formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 149a18598fe9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Maintainer scope and dependency proofMaintainer-side scope review is complete for The pinned Vitest 4.1.11 implementation was inspected directly in the dependency installation used for the proof, including the repository's existing patch. All five approved patched post-image identities matched the checked-in patch. The inspected contracts include This is supported by execution, not source inspection alone: the independent parent runs passed all 59 native report-owner cases and 342 planner cases with unchanged source bytes. Together with the complete worker sibling files, the selected inventory is 808 unique cases across nine files. Retained real-native runs cover exact unions, both schedulers, chunks, retries, failures, cancellation, incomplete evidence, metadata/error controls and publication faults. The full changed gate and fresh independent P0-scoped autoreview passed. The PR body records the commands, earlier corrected failures and remaining platform/product-suite limits. The stored-data heuristic refers to named native test reports and their per-run index, not OpenClaw runtime state, a database, cache migration or persistent application schema. Each new run allocates a new report set; no older application state is read or migrated. The repository's named-artifact/external-tool-contract exception applies. The remaining config-only/custom/other-format/inline/browser boundaries and native aggregate metadata limits are explicitly documented in the testing reference. This addresses the scope-acceptance item, the missing dependency-inspection item, the repeated maintainer-decision item and the rank-up request. No discrete code finding was waived. Exact-head hosted CI and native prepare/merge admission remain required before landing; this comment is not a claim that those later gates have completed. CI follow-upExact-head run 33315115990, attempt 1 failed in seven batch-fixture cases because Corepack lost its prepared pnpm resource after HOME isolation. The reproduced fail-fast case also showed a false green: the old assertions accepted bootstrap failure before any test executed. Commit The corrected candidate passed 851 unique cases across eleven complete files, eight retained native batch/control scenarios and the full changed gate. The parent independently passed all 59 report cases through the Corepack-backed, network-denied path without a pre-supplied npm_execpath. Fresh restricted P0 autoreview covered the complete original-base candidate and found no blockers. Earlier proof above remains historical evidence for the initial implementation; repeated executions are not double-counted. Land-ready validationExact-head CI 33318296093, attempt 1 completed successfully on I read the completed 15:10 UTC ClawSweeper review and reaffirm the scoped maintainer acceptance above. Its current-head validation and rank-up request are addressed by the green run and refreshed native preparation. The serialized-artifact heuristic still concerns named test reports, not an application store or migration. No concrete correctness/security finding was waived. Native merge is the next operation; no merged result is claimed here. |
|
Merged via squash.
|
* fix(test): retain reports across native test processes Preserve per-attempt native JSON, blob and coverage evidence across project and plugin-batch processes. Merge accepted disjoint case inventories through Vitest, retain originals and actual outcomes, and keep metadata child-owned. Fixes openclaw#133305. * test: preserve pnpm bootstrap in report fixtures
Closes #133305.
Additional instructions
This is a same-repository maintainer branch, so maintainers can push directly to it.
What Problem This Solves
Fixes an issue where developers requesting one JSON report for a multi-project test run received only the last native process's results, even though every child and the outer command exited successfully. In the isolated native reproduction, two children executed five cases but the final report contained only three.
Why This Change Was Made
The project and plugin-batch schedulers now share one artifact owner. It assigns each real invocation/attempt separate native JSON, blob and coverage destinations, retains the originals and actual process outcomes, and publishes an ordinary native Vitest aggregate only after validating complete accepted evidence and exact case/project attribution. Existing planners, runtime preparation, process supervision and retry owners remain in place. Serial and parallel project result handling now share one path.
Native merge is not universally lossless: snapshot summaries and JSON coverage maps stay authoritative in the retained original reports, and aggregate start time is merge time. Overlapping native task IDs can replace independent failure details even when case counts match, so that case retains both originals and fails aggregate publication with separate-invocation guidance. Native metadata/errors remain child-owned, without duplicate help or false report expectations.
A single-process rewrite would change existing process isolation and scheduling. Handwritten JSON/blob merging would duplicate native formats and still miss dependency semantics. Retaining original reports beside the native aggregate preserves the useful evidence without either change.
User Impact
Explicit CLI JSON file requests across supported named, file-based Node projects now account for all accepted cases. Developers also get a printed companion report-set directory containing original reports, per-attempt outcomes, coverage outputs and unstarted work. Complete failed-test aggregates remain useful and retain a failing command outcome; missing/corrupt evidence, interruption or failed publication cannot look complete.
Single-process, console-only, help and other native non-test behavior stay native. Config-only file reporters, other file formats, custom/tuple reporter options and inline/browser composition remain separate-invocation boundaries, documented with unique-output guidance. No application configuration, dependency, schema, installed state or messaging behavior changes.
Evidence
Hosted CI follow-up: run 33315115990, attempt 1 failed in
checks-node-compact-small-35: seven batch-fixture cases attempted a Corepack pnpm download with networking disabled. Commitcd9cbf9bd3daff4610582ac2f980ab393415ebd2repairs the fixture prerequisite: resolve the prepared pnpm executable before isolating HOME, then carry only that executable fact. Networking remains disabled, the existing 45-second fixture budget is shared, and no package-manager cache, dependency or production runner changes. Exact-head CI33318296093, attempt1 passed. Native review validation andOPENCLAW_TESTBOX=1 scripts/pr prepare-run 133309passed without rewriting the reviewed head. Native merge is next; no merged result is claimed yet.Maintainer scope acceptance and direct pinned-Vitest contract inspection address the published review's scope/dependency items and clarify that the stored files are named test artifacts, not application storage. The earlier local results below remain evidence for their executed environment, not a substitute for repaired-head CI.
Before the fix, the real serial wrapper reproduction exited 0 but retained only beta's three cases instead of alpha plus beta's five. The canonical regression also failed against a read-only pre-fix source export. Native JSON and blob bytes were not fabricated.
The corrected candidate passed 851 selected cases across eleven complete files, including all 59 native report-owner cases, 342 planner cases, the package-manager/shard-runner siblings and the existing process/report owners. The parent independently reran all 59 report cases through a real Corepack-backed parent with no supplied
npm_execpath, networking denied and writes restricted to owned paths. All source/dependency hashes were unchanged. Earlier independent 342-case planner proof and the 30 report/lifecycle plus 23 control scenarios remain retained; the corrected fixture also passed eight fresh native batch/control scenarios. Repeated executions are not added to the unique-case total.The CI failure exposed a real false-green fail-fast assertion: the old test accepted bootstrap failure with zero executed cases. The corrected negative rows require the intended native failure, corruption, readiness, timeout, replay or publication evidence, not merely a nonzero exit. The retained before/after counterexample proves failed alpha plus passing alpha sibling and unstarted beta on the repaired fail-fast path.
Independent commands included:
node scripts/run-vitest.mjs run --config test/vitest/vitest.tooling.config.ts test/scripts/vitest-report-owner.test.ts --configLoader=runner --reporter=verbose --reporter=json --outputFile='<owned-evidence>/native.json'node scripts/run-vitest.mjs run --config test/vitest/vitest.tooling.config.ts test/scripts/test-projects.test.ts --reporter=verbose --reporter=json --outputFile='<owned-evidence>/native.json'Proof ran on Node 24.15.0 with pinned pnpm 12.1.0 and fixture-owned HOME, state, configuration, workspace, XDG, temporary and cache paths. The corrected native-owner proof uses a Corepack-backed parent; the earlier planner proof used the prepared direct pnpm entry. The planner's Git operations were confined to newly created synthetic test repositories. Source hashes matched before and after.
Coverage includes serial/parallel project and real default batch execution, actual same-config include-file chunks, failure/skip/todo, native test retry, watchdog retry, unhandled errors independent of JSON success, native coverage/snapshot retention, missing/corrupt reports, teardown timeout, child/merge/publication write failures, cancellation, fail-fast/unstarted work, exact project identities, overlapping task IDs, native help/error/negation/alias controls, and single-process parity.
The full classified changed gate, scoped formatting and
git diff --checkpassed. A fresh independent P0-scoped Codex autoreview reportedscoped-cleanwith no findings on the complete original-base candidate, including the fixture follow-up. Application runtime is untouched; script/test-root typechecks and real native CLI/reporter loads cover these development-tool module boundaries. A product build, full product suite, browser lifecycle run and Windows process-group proof were not run.Earlier diagnostic failures remain accounted for: optional sandbox denial of
pswas resolved by running the full unchanged process-wrapper file in the ordinary trusted environment; bundled Vite reporter-config proof was repaired at its fixture-owned config/cache producer while keeping the default bundled loader. Initial metadata, overlap, expectation and lint failures were corrected and the complete affected proof rerun. None is presented as an earlier green run. The unrelated unresolved profiler-help investigation is not part of this fix.Size and ownership: production tooling +884/-152 (net +732), tests/support net +686, docs +48; application runtime 0. This is material tooling growth for native attempt capture, verified cross-process replay and publication across both schedulers. Consolidating the project result path removed 26 lines from the prior candidate; metadata and overlap correctness required additional code. There is no new executor, scheduler framework, handwritten native report format or runtime-state store.
Current-main comparison at
160c34d86b941cb7e79367848e53e3a7ae28d1b4found the changed files unchanged. Lock/workspace drift upgrades grammY and its types, not the inspected report dependencies or pnpm bootstrap policy. Adjacent planner and CI-test drift adds performance/release workflow-selection coverage; it does not alter native invocation/report ownership. The public reporting contract is documented indocs/reference/test.md.The fixture follow-up adds 147 test/support lines and zero production/tooling lines. Its first bootstrap attempt incorrectly reached dependency reconciliation through a shared test link; that failed run is retained. The final isolated prerequisite package uses the existing no-reconciliation setting, and retained proof verifies that it creates neither node_modules nor a lockfile. No prior failed run is relabeled green.