test(bundle): drive the lgtm cron's listing-500, closed-pr and evaluation-throw arms through dist/index.js - #335
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…tion-throw arms through dist/index.js Adds __tests__/bundle/cronLgtmFailureArms.test.ts, which runs the shipped bundle as the schedule lgtm job against the fake GitHub API for the three arms of src/cronJobs/lgtm.ts that no bundle suite reached: the open pull request listing answering 500 (could not get PRs), a closed pull request in the page skipped without a read while its open sibling merges, and a pull request re-read answering 500 (error processing pr). npm run test:coverage:e2e: src/cronJobs/lgtm.ts 4/40 statements unreached (lines 72, 88, 101, 108) -> 100 %; bundle suite 142 -> 145 tests. Closes #334 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 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 |
|
Please add a kind label with |
|
This PR only touches 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
Test Improvement
Adds one file,
__tests__/bundle/cronLgtmFailureArms.test.ts(3 tests), which runs the shippeddist/index.jsas theschedulejobs: lgtmjob against the fake GitHub API for the arms ofsrc/cronJobs/lgtm.tsthat no bundle suite reached:GET …/pulls?state=open&page=1→ 500 → exit 1,error handling cron job: Error: could not get PRs: HttpError: Internal Server Error, no call after the listing (cronLgtmL72)state: closedpull request (TESTING - Pull request comments #3) next to an open lgtm one (#2) → TESTING - Pull request comments #3 is logged as processed but never read and its base's tree is not probed; #2 squash-merges; exit 0 (L88)GET …/pulls/2→ 500 → exit 1,error handling cron job: TypeError: error processing pr: HttpError: Internal Server Error, noPUT, paging stops before page 2 (L101, L108)Each case asserts the exit status, the
::error::text and the exact request sequence after the configuration reads.Cluster:
src/cronJobs/lgtm.tscronLgtm/tryMergePrfailure and skip arms. Disjoint from the open hold-gated bundle PRs: #242 (cron dispatcherjobsinput, no lgtm run), #310 (handlePullReqjobs: lgtmon apull_requestevent), #318 (lgtmBinding/labels/lgtm.ts), #322 (tideevaluateInQueueskip arms), #328 (schedule lgtm on a fork whose merge is refused 403 →tide.ts/comments.ts) — none drives a failing listing, a closed listed pull request or a throwing evaluation.Evidence (
main@ 3fc21f2, Node v26.10.0, vitest 5.0.3):npx vitest run --coverage):src/cronJobs/lgtm.tsalready 100 %npm run test:coverage:e2e):src/cronJobs/lgtm.ts4/40 statements unreached (L72, 88, 101, 108) → 100 % statements / branches / functions / lines; bundle suite 142 → 145 tests, 6 files greennpx eslint __tests__/bundle/cronLgtmFailureArms.test.tsandnpx tsc --noEmitcleanRelated Issue
Closes #334
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1