Proposed labels: testing, area:backend, help wanted
Context
Scheduled-post cron modules make status, schedule-status, and batch-counter
transitions that are important to publishing reliability. The root test suite
currently concentrates on API contracts and release smoke checks rather than
these job outcome combinations.
Suggested starting points
job-runner/schedule-due-posts-cron.js
job-runner/publish-scheduled-cron.js
job-runner/publish-recurring-cron.js
job-runner/lib/publish-post-accounts.js
test/
Scope
Add the smallest practical dependency seams and fake models/publishers needed
to cover no-due-post, all-success, partial-success, and total-failure paths.
Assert post status, schedule status, and relevant batch counters for each path.
Non-goals
- Do not change scheduling or retry policy unless a failing test demonstrates
an existing defect and the maintainer agrees on the behavior.
- Do not invoke real providers, cron daemons, or database infrastructure.
Acceptance criteria
- Tests cover all four outcome classes for the affected scheduled/recurring
flow.
- Assertions include final post and schedule status plus batch accounting where
the module maintains it.
- The test suite is deterministic and makes no network calls.
- Production behavior is unchanged unless a separately documented bug fix is
included with a regression test.
Verification
- Run
npm test twice to confirm deterministic results.
- Confirm all provider/model boundaries in the new tests are faked.
- Run
git diff --check.
Proposed labels:
testing,area:backend,help wantedContext
Scheduled-post cron modules make status, schedule-status, and batch-counter
transitions that are important to publishing reliability. The root test suite
currently concentrates on API contracts and release smoke checks rather than
these job outcome combinations.
Suggested starting points
job-runner/schedule-due-posts-cron.jsjob-runner/publish-scheduled-cron.jsjob-runner/publish-recurring-cron.jsjob-runner/lib/publish-post-accounts.jstest/Scope
Add the smallest practical dependency seams and fake models/publishers needed
to cover no-due-post, all-success, partial-success, and total-failure paths.
Assert post status, schedule status, and relevant batch counters for each path.
Non-goals
an existing defect and the maintainer agrees on the behavior.
Acceptance criteria
flow.
the module maintains it.
included with a regression test.
Verification
npm testtwice to confirm deterministic results.git diff --check.