fix(test): update stale mocks in cleanup-service 'continues processing' test#1232
Conversation
…g' test (#1230) After PR #1034 changed worktree existence checks from execFileAsync to fs/promises.access, the mockExecFileAsync rejections had no effect. removeEnvironment needs getById + getCodebase mocks to proceed past the early-return guard, otherwise envs route to report.skipped instead of report.removed. Replace the two stale mockExecFileAsync rejection calls with proper mockGetById and mockGetCodebase return values for both test environments. Fixes #1230
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA test update that replaces git execution mocks with database lookup mocks to align with production changes, allowing the error-handling scenario to execute properly through the actual Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
🔍 Comprehensive PR ReviewPR: #1232 — fix(test): update stale mocks in cleanup-service 'continues processing' test SummarySurgical test-only fix (+27/-4, 1 file) that replaces stale Verdict:
🟢 Low IssuesPartial mock shapes for
|
⚡ Self-Fix Report (Aggressive)Status: COMPLETE Findings Summary
Fixes Applied(none) Tests Added(none) Skipped (1)
Suggested Follow-up Issues(none) Validation✅ Type check | ✅ Lint | ✅ Tests (no code changed) Self-fix by Archon · aggressive mode · no changes needed |
…g' test (coleam00#1230) (coleam00#1232) After PR coleam00#1034 changed worktree existence checks from execFileAsync to fs/promises.access, the mockExecFileAsync rejections had no effect. removeEnvironment needs getById + getCodebase mocks to proceed past the early-return guard, otherwise envs route to report.skipped instead of report.removed. Replace the two stale mockExecFileAsync rejection calls with proper mockGetById and mockGetCodebase return values for both test environments. Fixes coleam00#1230
Summary
runScheduledCleanup > continues processing after error on one environmenttest fails ondevwithexpected ['env-error (path missing)'] but got []dev(CI gate failure introduced by regression in PR fix(isolation): complete reports false success when worktree remains on disk (fixes #964) #1034)cleanup-service.test.ts— replaced two stalemockExecFileAsync.mockRejectedValueOncecalls with propermockGetById+mockGetCodebasereturn values for both test environmentscleanup-service.tsis untouchedUX Journey
Before
After
Architecture Diagram
Before
After
Connection inventory:
cleanup-service.test.tsmockExecFileAsynccleanup-service.test.tsmockGetByIdcleanup-service.test.tsmockGetCodebaseLabel Snapshot
risk: lowsize: XStestscore:cleanup-serviceChange Metadata
bugcoreLinked Issue
Validation Evidence (required)
Security Impact (required)
Compatibility / Migration
Human Verification (required)
bun run validatepasses cleanly; the previously-failing test now passesremoveEnvironmentvia paths wherepathExists=trueare unaffected (they don't hit thegetByIdearly-return)Side Effects / Blast Radius (required)
@archon/coretest suite onlyRollback Plan (required)
git revert HEAD— single commitRisks and Mitigations
None — test-only change with no production code impact.
Summary by CodeRabbit