← Back to PRs

#21190: test(cron-cli): assert cron.update patch schedule.staggerMs on edit

by ethvilet open 2026-02-19 19:24 View on GitHub →
cli size: XS
## Summary - **Problem:** The `sets explicit stagger for cron edit` test asserted `schedule.*` at the top level, but the CLI sends the update as `{ id, patch: { schedule: ... } }`, causing the assertion to read `undefined`. - **Why it matters:** Ensures correct validation of stagger behavior in cron edit, which is used for load-balanced scheduling. - **What changed:** Updated the test to assert `params.patch.schedule.kind` and `params.patch.schedule.staggerMs`. - **What did NOT change:** No CLI behavior changes; no gateway contract changes; test-only fix. --- ## Change Type - [x] Bug fix --- ## Scope - [x] CI/CD / infra --- ## Linked Issue/PR - Closes # - Related # --- ## User-visible / Behavior Changes None. --- ## Security Impact (required) - New permissions/capabilities? No - Secrets/tokens handling changed? No - New/changed network calls? No - Command/tool execution surface changed? No - Data access scope changed? No --- ## Repro + Verification ### Environment - OS: macOS - Runtime/container: Node + pnpm - Model/provider: N/A - Integration/channel: N/A (unit test only) - Relevant config (redacted): default local dev setup ### Steps 1. pnpm -s vitest src/cli/cron-cli.test.ts -t "sets explicit stagger for cron edit" ### Expected - Test passes. ### Actual - Test passes after assertion fix. --- ## Evidence - [x] Failing test before + passing after (local reproduction) --- ## Human Verification (required) - Verified scenarios: Ran targeted vitest test and full `src/cli/cron-cli.test.ts` locally. - Edge cases checked: None (test-only assertion path correction). - What you did **not** verify: No integration or e2e flows; no runtime gateway calls. --- ## Compatibility / Migration - Backward compatible? Yes - Config/env changes? No - Migration needed? No --- ## Failure Recovery (if this breaks) - Revert this commit (test-only change). --- ## Risks and Mitigations None. <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixed test assertion path to correctly validate stagger behavior in cron edit. The CLI sends `{ id, patch: { schedule: ... } }` to `cron.update`, but the test was asserting `schedule.*` at the top level, causing assertions to read `undefined`. Updated to assert `params.patch.schedule.kind` and `params.patch.schedule.staggerMs`. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - it's a test-only assertion fix with no behavior changes. - The change corrects a test assertion path to match the actual gateway RPC structure. The fix is straightforward, isolated to test code only, and aligns with other test patterns in the same file that already use `params.patch.*` correctly. No runtime code, CLI behavior, or gateway contracts are affected. - No files require special attention <sub>Last reviewed commit: 926c3ad</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs