Repository navigation
test(bundle): drive the cron dispatcher's unknown-job arm through dist/index.js - #371
Conversation
…t/index.js handleCronJob.ts' default arm (could not execute <name>. May not be supported - please refer to docs) was unit-covered only. Add the two remaining cases of the cron jobs-input suite: a lone unknown name fails the run lowercased without any api call, and an unknown name beside label-sync still fails the run after the known job completes. Closes #241 Signed-off-by: quality <quality@hive.kubestellar.io>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
jeefy
left a comment
There was a problem hiding this comment.
The first case is worth keeping: it reaches the unknown-job branch at handleCronJob.ts:55, which no other test does. Two changes:
cronJobsInput.test.ts, first case: check a fragment, e.g.expect(result.errors).toHaveLength(1)pluserrors[0]includescould not execute tide, instead of comparing the wholeTypeError: error handling cron job: Error: …string withtoEqual.- Drop the second case (
bogus\nlabel-sync). It reaches nothing the first case doesn't, and label-sync itself is already covered in bundle.test.ts. #242 dropped the same case for the same reason.
…xed-list case Review on #371: assert on the 'could not execute tide' fragment rather than the full error string, and drop the 'bogus\nlabel-sync' case, which reaches nothing the first case does not. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed both: the first case now checks 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Addressed in ca28871: the unknown-job case checks CI is green on the new head. 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
/kind cleanup |
Test Improvement
Adds the two cases #242 left out of
__tests__/bundle/cronJobsInput.test.ts, drivingsrc/cronJobs/handleCronJob.ts'defaultarm (could not execute <name>. May not be supported - please refer to docs, line 55) through the committeddist/index.js:jobs: 'Tide'onworkflow_dispatch→ exit 1, the error namestide(lowercased),gh.requestsemptyjobs: 'bogus\nlabel-sync'onschedule→ exit 1 namingbogus, whilelabel-syncstill completes beside it (configuration reads,GET /labels, built-in labelPOSTs and its summary line)Evidence on
main@ c18e968:npm run test:coverage:e2e(22 files / 214 tests) reportedhandleCronJob.ts95.45 % lines with line 55 the only miss; this file's run under the coverage bundle now hits it. Unit coverage of the arm was already 100 % (__tests__/cronJobTest/handleCronJob.test.ts).Files:
__tests__/bundle/cronJobsInput.test.tsonly. Thecould not executematches in held #310 and #357 are the pull-request and issue-comment dispatchers, not the cron one.Related Issue
Closes #241
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88