test(bundle): drive /retest's no-failed and already-re-running arms and /ok-to-test's author, already-trusted and approval-failure arms through dist/index.js - #304
Conversation
…nd /ok-to-test's author, already-trusted and approval-failure arms through dist/index.js The unit suite covers src/issueComment/trigger.ts fully, but the bundle suite only ran the happy paths of /retest and /ok-to-test (and /test's 409/403 arms). Add __tests__/bundle/triggerArms.test.ts to drive, against the fake GitHub: - /retest with no failed run (summary with and without counts), with every rerun-failed-jobs answering 409, with a non-409/403 re-run failure, with the run list failing, with the rocket reaction failing, and on a plain issue - /ok-to-test by the pull request author (and with the refusal comment itself failing), on a pull request already carrying ok-to-test with nothing awaiting approval, with the approval answering 403 and 500, and on a plain issue e2e coverage of trigger.ts under npm run test:coverage:e2e goes from 108/132 to 129/132 statements; the remaining three are payload-shape guards. Closes #303 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 |
|
Both runs on head 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Test Improvement
Adds
__tests__/bundle/triggerArms.test.ts(new file only; nothing else touched), driving the arms ofsrc/issueComment/trigger.tsthatbundle.test.tsandtriggerTestAndLgtmCancel.test.tsleave out through the committeddist/index.jsagainst the fake GitHub:/retestrerun-failed-jobsanswers 409 → "already being re-run", no rocketrerun-failed-jobs→could not re-run CI (1), action fails, no commentGET /actions/runsfails →could not list the workflow runs of headsha, no re-run attempted::warning::only, exit 0/retestonly applies to pull requests."/ok-to-testCould not comment with an auth errorlogged toook-to-test(case-insensitive) with nothing awaiting approval → "No workflow runs waiting for approval", no label write, no rocketcannot approve workflow runs: grant \actions: write``, fails before the label readcould not approve run 4 (E2E)/ok-to-testonly applies to pull requests."Each case asserts the exit status, the
::error::lines, the comment bodies and the exact request sequence after the authorization reads.Evidence
trigger.tsalready100 | 100 | 100 | 100(__tests__/issueCommentTest/trigger.test.ts,__tests__/pullReq).npm run test:coverage:e2e,main@ 3fc21f2):trigger.ts108/132 statements, 81.67 % lines.npx vitest run __tests__/bundle: 6 files / 155 tests pass;eslintclean.Overlap check: no open hold-gated bundle PR (#242–#302) touches
trigger.tsor this file.Related Issue
Closes #303
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88