Repository navigation
test: reuse planner modules between admission cases - #132444
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 3:26 AM ET / 07:26 UTC. ClawSweeper reviewWhat this changesThe PR re-imports the build-admission command entry with a unique module URL per test case while retaining planner modules, and moves an unchanged SQLite snapshot reader into test support. Merge readinessKeep open. This maintainer-authored, test-only optimization remains necessary on current main; no introduced correctness defect was established, but exact-head CI is still in progress. Priority: P3 Review scores
Verification
How this fits togetherBuild-admission tests invoke the project-test command under different preparation scenarios. The command selects runtime prerequisites before launching Vitest workers; this change alters only test-side module replay and a migration-test helper location. flowchart LR
A[Admission test cases] --> B[Fresh command entry]
B --> C[Shared planner modules]
C --> D[Runtime preparation]
D --> E[Vitest workers]
F[Migration test] --> G[Snapshot helper]
G --> H[SQLite assertions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +65, Tests -61. Total +4 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk options
Maintainer options:
Technical reviewBest possible solution: Land the focused test optimization and verbatim helper extraction after exact-head CI confirms the refreshed branch. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR changes test infrastructure rather than reporting a user-facing bug. Is this the best way to solve the issue? Yes. Replaying only the command entry retains the mocked planner dependencies while exercising each case’s argv and environment setup; the companion extraction is a verbatim test-only split. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 69913572f4a8. 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
HistoryReview history (2 earlier review cycles)
|
9673f8a to
ff99634
Compare
ff99634 to
90ea1a9
Compare
|
Merged via squash.
|
Main-heal: the media-persistence migration test file still exceeds max-lines after #132444's restructure. The four failure-mode cases move to a sibling failures file and shared fixtures extend the existing test-support module; byte-identical bodies, 15 cases conserved, no suppression.
* test: reuse planner modules between admission cases * test: extract media migration snapshot fixture
What Problem This Solves
Build-admission tests clear the entire module graph before every case. Replaying the command therefore reloads its planner dependencies repeatedly, adding several seconds per in-process case.
Why This Change Was Made
Import a fresh URL for the command entry on each invocation while retaining its planner dependencies. Vite keys entry modules by their query-bearing URL. Repository inventories stay unchanged within this isolated test file; environment flags and include-file contents are read per invocation. Existing mock resets, completion waits, environment/argv cleanup, and real subprocess tests remain unchanged.
User Impact
All 65 admission cases fell from 45.30s to 7.90s of local execution, repeating at 6.46s. Production +0/-0; tests +4/-2. No sharding, worker count, case ordering, concurrency, or test-selection changes.
Evidence
node scripts/run-vitest.mjs test/scripts/test-projects-build-admission.test.ts(65 passed).test/scripts/test-projects.test.ts: all 386 passed in their existing order/configurations.Current-main integration
The first hosted CI run exposed a stale lint-suppression baseline after #132399 added credential-safe packaged-plugin setup errors. The existing auth-bootstrap boundary already omits raw error causes for the same reason. The expected count was corrected from one to two without adding or relaxing a production suppression. That same correction independently landed in #132394, so the final rebase drops our duplicate baseline commit and retains only the admission import change. The original lint test failed before correction, then all 69 admission/lint cases passed. Both real QA CLI auth/plugin failure tests also passed and retained their assertions that credentials appear in neither the error message nor its cause. Fresh Codex autoreview found no actionable findings.
Follow-up from the planner audit: the serial untargeted-full-suite case in
test/scripts/test-projects.test.tsdeletes two environment variables without restoring their prior values. This pre-existing cleanup issue is outside the admission-import optimization.The exact final head passed all 390 admission, planner and lint-ratchet tests. Fresh post-rebase Codex autoreview through P3 is clean. The preceding head passed both hosted CI and Linux changed checks; final hosted CI is rerunning after the mechanical rebase. Direct installed Vite source inspection confirms query-bearing module URLs remain distinct while dependency URLs are reused. This addresses ClawSweeper's dependency-inspection gap; its exact-head CI request remains a pre-merge gate.
Shared CI integration repair: #132099 left
state-migrations.media-persistence.test.tsabove the max-lines limit. Move its existing snapshot reader verbatim into test support; all 15 migration cases, assertions, SQL queries, cleanup hooks and database-close behavior remain unchanged. All 15 cases passed before and after, focused lint passed, and fresh Codex autoreview through P3 is clean. Production and schema delta are zero; tests/support +66/-64. This repair is shared across the pending performance branches so it lands once without waiting on a known broken main check.Final exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/33240544351. Latest ClawSweeper has no actionable findings; its remaining CI rank-up request is fulfilled. The data-model detector matched relocated test SQL only: there is no runtime/schema change.