Repository navigation
test(bundle): drive /hold cancel's no-label, failed-read, failed-removal and already-gone arms through dist/index.js - #326
Conversation
…val and already-gone arms through dist/index.js Adds __tests__/bundle/holdCancelArms.test.ts: /hold cancel, /unhold and /remove-hold on an issue carrying no hold label, a 500 on the labels read, a 500 on the label DELETE, and a 404 on one DELETE (a label gone between read and removal), all run through the committed bundle against fakeGithub. Measured with npm run test:coverage:e2e on main @ 3fc21f2: src/labels/hold.ts 80 % -> 96 % lines, 81.81 % -> 90.9 % branches; src/utils/labeling.ts 73.07 % -> 76.92 % lines (removeLabels' benign 404 arm). The one remaining hold.ts line is the missing-issue-number throw, unreachable through the API. 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 |
jeefy
left a comment
There was a problem hiding this comment.
holdCancelArms.test.ts:27: reduceit.each(['/hold cancel', '/unhold', '/remove-hold'])to a single/hold cancelcase. All three rows reach the same lines and branches (hold.ts:67–69), and the alias handling is already covered on main.
Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed: the 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Addressed in 8a99d52: the 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
__tests__/bundle/holdCancelArms.test.ts(new file only; importscomment,configReads,helpersFor,repo,tokenfrom./helpers) — six cases run through the committeddist/index.jsagainstfakeGithub, covering thecancelHoldarms ofsrc/labels/hold.tsthat no bundle suite reached:/hold cancel,/unhold,/remove-holdon an issue whose labels are[lgtm]→ exit 0, noDELETE, requests are the config reads thenGET /issues/1(hold.ts L67–69)./hold cancelwithGET /issues/1→ 500 → exit 1, error carriescould not get labels from issue, noDELETE(L60–61)./hold cancelwithDELETE …/labels/do-not-merge%2Fhold→ 500 → exit 1, error carries bothcould not remove the hold labeland the causecould not remove label do-not-merge/hold(L75–76)./hold cancelwithhold+do-not-merge/holdpresent,DELETE …/labels/hold→ 404, the other → 200 → exit 0, both DELETEs sent (src/utils/labeling.tsL202–203, the benign gone-label arm).Cluster:
src/labels/hold.tscancelHold+src/utils/labeling.tsremoveLabels404 arm. Disjoint from #293 (holdSweepSettings: configuredhold.label, label present) and from bundle.test.ts's/unholdcase (both labels present, writes accepted).Measured with
npm run test:coverage:e2eonmain@ 3fc21f2, before → after:src/labels/hold.ts80 % → 96 % lines, 81.81 % → 90.9 % branches;src/utils/labeling.ts73.07 % → 76.92 % lines; bundle suite 142 → 148 tests. The remaininghold.tsline (L30, missing issue number) cannot be produced through the API.Verified locally:
npx vitest run __tests__/bundle/holdCancelArms.test.ts→ 6 pass;npx eslintandnpx tsc --noEmitclean.Related Issue
Closes #325
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88