Repository navigation
test(bundle): drive the sweep cron's enqueued outcome (sweep.ts:75) through dist/index.js - #385
Conversation
…dex.js Adds __tests__/bundle/sweepEnqueued.test.ts: schedule with jobs: sweep on a fork pull request whose base branch requires a merge queue. The bound lgtm candidate is enqueued pinned to its head (one enqueuePullRequest mutation, no PUT merge) and the sweep reports it as enqueued; a second case keeps the enqueued result while another candidate's enqueue is refused and the run fails naming only that one. Reaches src/cronJobs/sweep.ts:75, which no bundle test exercised. 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 |
|
/kind cleanup 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
jeefy
left a comment
There was a problem hiding this comment.
Both cases reach only sweep.ts:75. The failure listing (sweep.ts:78, 83–84) and the refused enqueue are already covered on main.
sweepEnqueued.test.ts:91–125: drop the second case.
…weep.ts:75 Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed in 0c5fb12: dropped the second case (enqueued + failing sibling); only the single enqueued-candidate case that reaches sweep.ts:75 remains. 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Test Improvement
Adds
__tests__/bundle/sweepEnqueued.test.ts(new file only — no production, harness or config change), driving the sweep cron'senqueuedoutcome throughdist/index.jsagainst the fake GitHub:schedulewithjobs: sweepon a fork pull request carrying a boundlgtmwhose base branch has a merge queue (gh.mergeQueue({ enabled: true })): the candidate is enqueued pinned to its head (oneenqueuePullRequestmutation withexpectedHeadOid: sha1, noPUT …/merge), stdout carriesenqueued pr #1 (position 1)andsweep: #1 enqueued, and the request order is config reads → listing page → OWNERS probe → pull read → binding read → queue state → enqueue.sweep: #1 enqueued,sweep: #2 evaluated with 1 error(s), run exits 1 naming only#2 (tide: cannot add pr #2 to the merge queue …).Files/functions claimed:
__tests__/bundle/sweepEnqueued.test.ts(new) only;src/cronJobs/sweep.tsline 75 (result.enqueued.push) viasweep→sweepPullRequest→evaluateMerge→evaluateInQueue. Disjoint from #345 (sweepArms.test.ts, which explicitly leaves line 75 out), #322 (mergeQueueArms.test.ts,pull_request labeledevents only) and #347 (tideVerdictArms.test.ts, verdict arms).Measured with
vitest run --coverage --config vitest.e2e-coverage.config.mjs __tests__/bundle/sweepEnqueued.test.tsonmain@ aa6a0f8:sweep.ts:75goes from 0 to 2 hits.npx eslintclean; both tests pass against the committeddist/index.js.Related Issue
Closes #384
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1