test: cover list and status cli output#154
test: cover list and status cli output#154ndycode wants to merge 4 commits intorefactor/pr1-report-commandfrom
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary
codex auth listandcodex auth statusWhat Changed
test/codex-manager-cli.test.tswith coverage for:codex auth listcodex auth statusValidation
npm run test -- test/codex-manager-cli.test.tsnpm run lintnpm run typecheckRisk and Rollback
5862826to remove the new list/status regression coverageAdditional Notes
note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this pr adds black-box vitest coverage for
codex auth list(empty storage path) andcodex auth status(populated storage path), and fixes theformatAccountLabelmock format to align with the real implementation. all three issues from the previous review round are resolved: therateLimitResetTimesfield name is now correct, both new tests assertsetStoragePath(null)and theStorage:log line, and the doubled-index label bug is gone.formatAccountLabelmock updated from`${index + 1}. ${email}`to`Account ${index + 1} (${email})`— matches the real implementation's email-only branchauth listwith null storage asserts"No accounts configured.",Storage:path, andsetStoragePath(null)callauth statuswith two accounts assertsAccounts (2),Storage:path,[current]on account 1, and[disabled, rate-limited]on account 2coolingDownUntilfixture field is silently suppressed by the globalformatCooldownmock, leaving the cooldown marker branch uncovered — minor coverage gap worth addressingConfidence Score: 4/5
vi.restoreAllMocks()inafterEachis in place, and the 60-second rate-limit buffer prevents any timing flakiness. one minor coverage gap remains (cooldown branch) but it doesn't break anythingImportant Files Changed
auth list(empty storage) andauth status(populated storage); the three issues flagged in the previous review round are all resolved (rateLimitResetTimesfield name,setStoragePath(null)assertion, doubled-index label format), but account 1'scoolingDownUntilfixture field is silently suppressed by the globalformatCooldownmock, leaving the cooldown marker branch uncovered.Sequence Diagram
sequenceDiagram participant Test participant CLI as runCodexMultiAuthCli participant Status as runStatusCommand participant Storage as loadAccounts / getStoragePath Note over Test: "auth list" — empty path Test->>CLI: runCodexMultiAuthCli(["auth", "list"]) CLI->>Status: runStatusCommand(deps) Status->>Status: deps.setStoragePath(null) Status->>Storage: loadAccounts() → null Status->>Storage: getStoragePath() → "/mock/..." Status-->>Test: log "No accounts configured." + "Storage: ..." Test->>Test: assert exitCode=0, setStoragePath(null), log lines ✓ Note over Test: "auth status" — populated path Test->>CLI: runCodexMultiAuthCli(["auth", "status"]) CLI->>Status: runStatusCommand(deps) Status->>Status: deps.setStoragePath(null) Status->>Storage: loadAccounts() → {accounts: [active, disabled]} Status->>Storage: getStoragePath() → "/mock/..." Status->>Status: resolveActiveIndex → 0 Status->>Status: formatAccountLabel(account, 0) → "Account 1 (active@example.com)" Status->>Status: formatRateLimitEntry(account1) → null Status->>Status: formatCooldown(account1) → null (mocked) Status-->>Test: log "1. Account 1 (...) [current] used 1s ago" Status->>Status: formatAccountLabel(account, 1) → "Account 2 (disabled@example.com)" Status->>Status: formatRateLimitEntry(account2, codex) → "resets in 1m 0s" Status-->>Test: log "2. Account 2 (...) [disabled, rate-limited] used 1s ago" Test->>Test: assert all log lines ✓Prompt To Fix All With AI
Last reviewed commit: "align auth status te..."