Repository navigation
Conversation
Native non-watch --changed selections resolved through the local planner's unrestricted import graph and ran their concrete plans serially. Reuse the maintained CI changed-test owner for selection and feed its concrete files into the existing exact-target admission so independent plans overlap. Fixes openclaw#162615
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. Reviewed October 1, 2026, 8:22 AM ET / 12:22 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR makes non-watch changed-test runs reuse CI’s affected-test selection and existing bounded scheduler, preserves a required compiled-runner asset, and adds regression coverage. Merge readiness⛔ Needs changes before merge - 1 item remains This remains a useful fix: current main still uses the divergent changed-test route. No blocking code defect was found, and the supplied CLI evidence supports the integration. The earlier test-cost reporting request remains unresolved. Likely related people: Peter Steinberger and Vincent Koc, based on recent selector and scheduler history. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s test runner turns developer arguments and changed Git paths into test selections owned by different Vitest projects. Its scheduling gate then decides whether those projects can overlap safely. flowchart TD
A[Developer test command] --> B[Invocation mode]
B -->|Native changed run| C[CI affected-test selector]
B -->|Watch or explicit selectors or broad mode| D[Existing local planner]
C --> E[Concrete test files]
D --> F[Owned test plans]
E --> F
F --> G[Scheduling and isolation checks]
G --> H[Vitest results]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +155, Other +51. Total +206 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one maintained affected-test selection policy feeding the existing scheduler, with watch, explicit-selector, and broad-mode contracts preserved. Do we have a high-confidence way to reproduce the issue? Yes, current-main source establishes both the divergent native changed selector and the explicit-target prerequisite that prevents its automatic overlap. This read-only review did not execute tests. Is this the best way to solve the issue? Yes, reusing the existing CI selector and scheduler is the narrowest repair, and the supplied real CLI trace demonstrates the changed entry point reaching scheduling admission. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ab1b93295ad0. LabelsLabel changes: No label changes. Label 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
HistoryReview history (1 earlier review cycle)
|
…tries The runtime worker layout now imports the CI changed-test owner, whose policy watch inventory reads scripts/pr-lib/wrapper-components.txt at module load. Preserve those bytes in the prepared layout so compiled runner entries keep starting without the source checkout.
44bb1fe to
65e5f7d
Compare
|
Thanks for the investigation and patch. I narrowed #162615 to the confirmed scheduling defect, and #162701 has now landed that fix while preserving existing changed-test selection behavior. My original report conflated that defect with the difference between broad local selection and CI's bounded selection. The target-count comparison did not establish that the additional coverage was unnecessary. This PR also changes the default native selection policy, so I have closed it as outside the corrected issue's scope. Changing that default needs a separate coverage justification and discussion. |
Closes #162615
What Problem This Solves
A native
pnpm test --changed <base>run selected tests through the local planner's unrestricted import graph instead of the maintained CI affected-test owner, so a focused source change could resolve to thousands of targets: selectingsrc/plugins/runtime/types.tsresolved 11,789 targets and 59 plans. Because the concrete selection never became explicit file arguments, the runner also admitted no automatic inter-plan overlap — independent plans ran serially even when the selection satisfied the existing CI host, output-safety, and cache-ownership admission checks.Why This Change Was Made
The CI changed-test owner (
resolveChangedNodeTestTargets) already encodes the maintained selection policy: bounded owners, alias resolution, runtime-only import edges, sibling coverage, protected runtime tests, policy watches, and fixed PR smoke coverage. Reusing that owner for native non-watch--changedruns is narrower and more maintainable than re-filtering the local graph — filtering type-only edges alone still leaves ~10,196 targets through the unrestricted runtime graph. Feeding the owner's concrete files into the run's effective target arguments also lets the existing exact-target admission treat a changed selection exactly like an explicit selector invocation, unlocking the existing bounded scheduler without scheduler changes.Watch mode, explicit test/source selectors, and the
OPENCLAW_TEST_CHANGED_BROAD=1escape hatch keep their established planner route. Exclusive-suite barriers, output isolation, cache ownership, and the explicit serial override are unchanged, as they live downstream of the admission gate.User Impact
Developers running
pnpm test:changednow get the same focused scope CI uses for changed files — bounded selections with protected and smoke coverage instead of unbounded fan-out — and eligible plans execute through the bounded scheduler with joined barriers instead of forced serialization. Compiled runner entries also retain the wrapper-component inventory the reused policy watch reads at module load, so prepared-layout CLI startup keeps working.Evidence
Real environment tested: yes — real
scripts/test-projects.mts --changed <base>CLI invocations at the PR head in an isolated worktree (docs-only change fixture as the changed set), plus regression tests drivingrunTestProjectsend to end with mocked child processes.Exact steps or commands run after this patch:
node --import ./scripts/tsx.mjs scripts/test-projects.mts --changed HEAD^ --reporter=dot --coverage.enabled=falsewithCI=1(changed set:docs/help/testing.mdonly)OPENCLAW_TEST_PROJECTS_SERIAL=1(explicit serial override)OPENCLAW_TEST_CHANGED_BROAD=1(broad escape hatch)src/plugins/runtime/types.ts: local planner vs CI affected-test ownerbash skills/fix-pr/scripts/validate.sh(oxfmt + oxlint + same-directory tests +tsgo:core) on all changed files; full runs oftest/scripts/test-projects-build-admission.test.ts(178 passed, including 4 new regression tests),test-projects.test.ts,test-projects-routing.test.ts,ci-changed-node-test-plan.selection.test.ts,vitest-plan-scheduling.test.ts(341 passed across the four)Evidence after fix:
Observed result after fix: The native non-watch changed run resolves through the CI affected-test owner (6 fixed smoke tests for the docs-only fixture instead of 376 test-projects tests), its concrete selection is admitted by the existing exact-target gate ("running 3 exact-target plans ... joined exclusive barriers"), the explicit serial policy and the broad escape hatch keep their established behavior, and all regression tests pass. The evidence host is resource-constrained, so the admitted plan concurrency resolved to 1 there; the admission suite with a 24 GiB / 8-CPU host observes peak 2 concurrent plans, matching the explicit-selector behavior.
What was not tested: Full CI lanes (
test-projects --changed, fullcheck:test-types,pnpm check:changed) were not run locally — they are left to GitHub Actions (CI lanes pending). Concurrency above 2 and non-Linux process-group admission rely on CI hosts, exercised only through the mocked admission suite.