Skip to content

test(bundle): drive the lgtm cron's listing-500, closed-pr and evaluation-throw arms through dist/index.js - #335

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-cron-lgtm-failure-arms
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-cron-lgtm-failure-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds one file, __tests__/bundle/cronLgtmFailureArms.test.ts (3 tests), which runs the shipped dist/index.js as the schedule jobs: lgtm job against the fake GitHub API for the arms of src/cronJobs/lgtm.ts that no bundle suite reached:

  1. 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 (cronLgtm L72)
  2. page 1 holds a state: closed pull 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)
  3. the listed pull request's re-read GET …/pulls/2 → 500 → exit 1, error handling cron job: TypeError: error processing pr: HttpError: Internal Server Error, no PUT, 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.ts cronLgtm / tryMergePr failure and skip arms. Disjoint from the open hold-gated bundle PRs: #242 (cron dispatcher jobs input, no lgtm run), #310 (handlePullReq jobs: lgtm on a pull_request event), #318 (lgtmBinding / labels/lgtm.ts), #322 (tide evaluateInQueue skip 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):

  • unit (npx vitest run --coverage): src/cronJobs/lgtm.ts already 100 %
  • e2e (npm run test:coverage:e2e): src/cronJobs/lgtm.ts 4/40 statements unreached (L72, 88, 101, 108) → 100 % statements / branches / functions / lines; bundle suite 142 → 145 tests, 6 files green
  • npx eslint __tests__/bundle/cronLgtmFailureArms.test.ts and npx tsc --noEmit clean

Related Issue

Closes #334


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5.1

…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>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 5, 2026 21:58
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 5, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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 outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind failing-test or /kind cleanup.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

build-test on 34f2aa5 is red for the shared cause tracked in #294, not for this diff:

This PR only touches __tests__/bundle/; the durable fix is #287. Deferring until #294 closes; no re-run or push for this failure.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 34f2aa5

— hive: agent=quality backend=copilot model=claude-fable-5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] cronJobs/lgtm.ts listing-500, closed-pr and evaluation-throw arms have no end-to-end coverage

0 participants