Repository navigation
refactor(test): restore auth persistence integrity - #125699
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 5:35 AM ET / 09:35 UTC. ClawSweeper reviewWhat this changesThis PR replaces obsolete auth-profile test mocks with SQLite-backed test state, consolidates repeated fixtures and temp-directory helpers, and accepts npm 12 Merge readinessNo discrete correctness defect was found in the current checkout: the SQLite-backed auth assertions and the importer-scoped Docker-pruning regression are present. Keep this active maintainer-owned PR open while its exact-head checks finish and the new npm 12 parsing path is exercised. Likely related people: steipete (current test-infrastructure contributor; medium confidence). Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherOnboarding auth tests call provider-auth helpers that persist credentials to an agent-scoped SQLite store. Shared test fixtures also underpin outbound-channel, plugin-packaging, and Docker dependency-pruning regression tests. flowchart LR
A[Onboarding auth test] --> B[Auth test lifecycle]
B --> C[SQLite auth profile store]
C --> D[Persisted-profile assertions]
E[Shared test fixtures] --> F[Outbound and plugin tests]
F --> G[Packaging and Docker regressions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +63, Tests -713, Docs -2. Total -652 across 43 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the SQLite owner-boundary regressions and shared fixtures, then validate the package-manifest suite under npm 12 before merging. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR changes test infrastructure rather than reporting a user-facing failure; its main regression path is source-visible in the onboarding auth tests. Is this the best way to solve the issue? Yes for auth persistence: using the production writer and persisted SQLite reader is a stronger owner-boundary regression than the removed JSON mock. The separate npm 12 parser addition still needs execution against its stated runtime contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b8ff4fe3d7d6. LabelsLabel 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)
|
Restore the SQLite-backed auth wizard assertions traced to 43ea501 and consolidate duplicated message-action and temp-directory fixtures.
9441e88 to
49de10a
Compare
|
Accepted P1 addressed on Restoration: rebased onto current Additional bounded repair: the touched plugin npm-manifest suite exposed npm 12's object-form Evidence:
Known local proof gap: broad @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* test: restore auth persistence integrity Restore the SQLite-backed auth wizard assertions traced to 43ea501 and consolidate duplicated message-action and temp-directory fixtures. * test: support npm 12 pack results
What Problem This Solves
Fixes a test-infrastructure integrity gap where onboarding auth tests passed by writing and reading an obsolete
auth-profiles.jsonmock even though production persists auth profiles in SQLite. A regression in the real store owner could therefore ship while the tests remained green.The same test area also carried seven copies of one message-action plugin fixture, two copies of the context registry setup, and several plugin-local temp-directory trackers that had drifted from the shared helper.
Why This Change Was Made
The auth wizard tests now call the production profile writer, read actual persisted SQLite rows, and use the tracked OpenClaw test-state lifecycle. This restores the real-store test shape previously present in
43ea501f38d, adapted to current OAuth ownership and cleanup contracts, and deletes the JSON mock plus the command-local re-export facade.Repeated ActionHub/context fixtures now have canonical factories with explicit setup and cleanup. Plugin-local temp trackers reuse the public Plugin SDK test helper, matching temp-repo callers use the shared tracker, and the obsolete synchronous-loader string-grep test/guidance is removed.
User Impact
There is no runtime behavior change. Maintainers get regression coverage that can fail on real auth persistence defects, while shared test support is 676 lines smaller and less likely to drift under non-isolated Vitest execution.
Evidence
Expected SQLite auth profile store; removing it restores 13/13 passing tests.pnpm check:changedpassed on the final diff, including core/extension/root typechecks, core/extension/script lint, dead exports, plugin boundaries, import cycles, database-first, and auth guards.git diff --checkpassed.+0/-0; tests, test support, and guidance+320/-996(net-676).AI-assisted.