Skip to content

test(bundle): drive the sweep cron's enqueued outcome (sweep.ts:75) through dist/index.js - #385

Merged
mrbobbytables merged 3 commits into
mainfrom
quality/test-sweep-enqueued
Oct 9, 2026
Merged

mrbobbytables merged 3 commits into
mainfrom
quality/test-sweep-enqueued

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/sweepEnqueued.test.ts (new file only — no production, harness or config change), driving the sweep cron's enqueued outcome through dist/index.js against the fake GitHub:

  • schedule with jobs: sweep on a fork pull request carrying a bound lgtm whose base branch has a merge queue (gh.mergeQueue({ enabled: true })): the candidate is enqueued pinned to its head (one enqueuePullRequest mutation with expectedHeadOid: sha1, no PUT …/merge), stdout carries enqueued pr #1 (position 1) and sweep: #1 enqueued, and the request order is config reads → listing page → OWNERS probe → pull read → binding read → queue state → enqueue.
  • two candidates where the second's enqueue is refused: 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.ts line 75 (result.enqueued.push) via sweep → sweepPullRequest → evaluateMerge → evaluateInQueue. Disjoint from #345 (sweepArms.test.ts, which explicitly leaves line 75 out), #322 (mergeQueueArms.test.ts, pull_request labeled events only) and #347 (tideVerdictArms.test.ts, verdict arms).

Measured with vitest run --coverage --config vitest.e2e-coverage.config.mjs __tests__/bundle/sweepEnqueued.test.ts on main @ aa6a0f8: sweep.ts:75 goes from 0 to 2 hits. npx eslint clean; both tests pass against the committed dist/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

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/kind cleanup


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

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

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-kind labels Oct 8, 2026

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 0c5fb12: dropped the second case (enqueued + failing sibling); only the single enqueued-candidate case that reaches sweep.ts:75 remains.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 0c5fb12

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

@mrbobbytables
mrbobbytables merged commit 521f593 into main Oct 9, 2026
5 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-sweep-enqueued branch October 9, 2026 18:00
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] the sweep cron's enqueued outcome (sweep.ts:75) has no end-to-end coverage — no bundle test runs jobs: sweep on a merge-queue branch

2 participants