Repository navigation
refactor(tests): share API-key credential inputs - #142245
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed September 8, 2026, 10:55 AM ET / 14:55 UTC. ClawSweeper reviewWhat this changesReplaces repeated API-key credential inputs in auth-profile tests with a small shared constructor while preserving existing scenarios and expectations. Merge readiness✅ Ready for maintainer review Keep open as a focused, behavior-preserving test cleanup. The complete introduced diff preserves inputs and assertions, and the consolidation is absent from reviewed main. No actionable correctness finding was identified. Priority: P3 Review scores
Verification
How this fits togetherAuth profiles supply credentials and account-selection state to OpenClaw providers and sessions. These tests exercise ordering, persistence, OAuth interactions, and session selection using synthetic credentials. flowchart LR
A[Synthetic provider and key] --> B[Shared test fixture]
B --> C[Auth profile test inputs]
C --> D[Ordering and persistence]
C --> E[Session credential selection]
D --> F[Independent assertions]
E --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -288. Total -288 across 17 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the constructor data-only and preserve literal expected results so shared setup cannot conceal credential regressions. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates test inputs rather than repairing a reported runtime defect; source inspection confirms equivalent fixture construction. Is this the best way to solve the issue? Yes. A dependency-free constructor removes repeated setup while preserving explicit provider/key values, fresh allocation, and independent expectations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0f3db48abbf0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Auth-profile tests repeat the same three-field API-key credential input across ordering, persistence, selection, and mutation scenarios, obscuring the behavior each case exercises.
Why This Change Was Made
Replace 79 input literals with a small, data-only constructor requiring provider and key. It preserves the exact
type,provider,keyorder, optional-field absence, string values, fresh allocation, and existing bindings. Independent expected objects stay literal. The helper has no runtime dependencies, defaults, normalization, or casts.User Impact
No production behavior changes. This removes 288 net test/support lines across 16 suites plus the six-line helper, while retaining every scenario and assertion.
Evidence