Skip to content

test(utils): pin parseDuration's whitespace trim and millisecond rounding, and desiredLabels' case-insensitive needs- color - #542

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-duration-needs-color
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-duration-needs-color

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files: __tests__/utils/duration.test.ts (new), __tests__/utils/labelCatalog.test.ts. No src/, dist/, docs/ or config change — disjoint from every open held PR (#510–#541): the existing parseDuration table lives in __tests__/plugins/requireMatchingLabel.test.ts, which #520 occupies, so the new cases get their own file under __tests__/utils/.

A single-operator mutation probe over src/utils/{duration,labelCatalog,labeling,comments}.ts on main @ 88241f4 (details in the folded record on #523) left three non-equivalent survivors against their npx vitest related sets. One case per survivor:

  • duration.ts:12 .trim() removed — parseDuration accepts ' 5s', '5s ', '\t2m\n', ' 0 ' and ' ' (yaml-folded values), returning 5000 / 5000 / 120000 / 0 / 0 rather than throwing.
  • duration.ts:29 Math.round removed — 1.5ms, 2.25ms and 0.0015s all yield the integer 2.
  • labelCatalog.ts:86 toLowerCase() before startsWith('needs-') removed — desiredLabels gives Needs-Kind and NEEDS-SIG missing labels the ededed color.

Also pins the field parameter of parseDuration's error (invalid delay 'soon'), which only the default was asserted for.

Verification (this branch, local)

  • npx vitest run __tests__/utils/duration.test.ts __tests__/utils/labelCatalog.test.ts: 24 passed
  • same, with each mutant applied in turn: 5 / 3 / 1 failed (mutants reverted, not committed)
  • npx eslint on both files: clean

Related Issue

Refs #523 — hive-open-issue consolidated this finding onto that tracker (its newest comment carries the full table); the tracker's own trigger.ts items and the other folded findings remain open and are owned by other PRs (#524, #528, #537, #541).


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

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

…ding, and desiredLabels' case-insensitive needs- color

A single-operator mutation probe over src/utils/duration.ts and
src/utils/labelCatalog.ts left three survivors: dropping .trim() at
duration.ts:12, dropping Math.round at duration.ts:29, and dropping the
toLowerCase() before startsWith('needs-') at labelCatalog.ts:86. Each now
fails at least one test.

Refs #523

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 20, 2026 20:55
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 20, 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. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

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

Copy link
Copy Markdown
Contributor

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

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.

0 participants