Skip to content

Add JobService unit tests for validation, scheduling, and removal#758

Merged
selfcontained merged 1 commit into
mainfrom
agt_6283460cdaaa/job-test-enforcer-dada9b40
Jul 12, 2026
Merged

Add JobService unit tests for validation, scheduling, and removal#758
selfcontained merged 1 commit into
mainfrom
agt_6283460cdaaa/job-test-enforcer-dada9b40

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Adds 21 unit tests covering previously untested JobService paths
  • Tests addJob validation (invalid cron, enabled without schedule, empty schedule normalization, template creation, field defaults)
  • Tests updateJob logic (cron validation, name conflict detection, template propagation, scheduler stop on disable)
  • Tests enableJob/disableJob validation and state transitions
  • Tests removeJob template cleanup and error paths
  • Tests runJob singleton enforcement and crash-on-spawn handling
  • Tests listRunsForJob and getStats

Server test count: 2310 → 2331 (+21)

Test plan

  • pnpm run check passes
  • pnpm run test passes (2331 server, 195 web)
  • pnpm run test:e2e passes (168 passed, 12 skipped)
  • No flaky test risk (no timing dependencies, each test creates own service instance and shuts down)

🤖 Generated with Claude Code

Cover addJob validation (invalid cron, enabled without schedule, empty schedule
normalization, template creation, field defaults), updateJob logic (cron
validation, name conflict detection, template propagation, scheduler stop),
enableJob/disableJob paths, removeJob template cleanup, runJob singleton
enforcement and crash handling, listRunsForJob, and getStats.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@selfcontained selfcontained merged commit dad84f7 into main Jul 12, 2026
1 check passed
@selfcontained selfcontained deleted the agt_6283460cdaaa/job-test-enforcer-dada9b40 branch July 12, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant