Repository navigation
test(bundle): drive the lgtm cron's listing-500, closed-pr and evaluation-throw arms through dist/index.js - #335
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 |
|
This PR only touches 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
/kind cleanup |
|
/lgtm |
…ation fails (#375) The lgtm cron's doc comment and docs/automatic-merging.md say every eligible pull request is attempted and the run fails at the end listing the failures. That held for merges GitHub refused, but an evaluation that threw (for example a 500 re-reading one pull request) made the page throw `error processing pr: ...`, so the remaining pages were never evaluated. A throwing evaluation is now logged with core.error as `could not evaluate pr #<n>: <error>` and collected with the refused merges; the job goes on with the remaining pull requests and pages and fails at the end with the existing summary, e.g. `1 pull request(s) could not be merged: #7 (could not evaluate: HttpError: ...)`. A listing of the open pull requests that cannot be read still stops the job (`could not get PRs`). Tests: the unit case and the bundle case (#335) that pinned the fail-fast behaviour now assert that a later pull request (same page, and the next page) is still evaluated and merged and that the run fails naming the broken one. docs/cron-jobs.md and docs/automatic-merging.md describe the evaluation-failure arm. Signed-off-by: Jeffrey Sica <me@jeefy.dev>
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