test(utils): cover the error and edge branches of labelMatch, labeling, comments and config - #198
Merged
Merged
Conversation
…g, comments and config Adds __tests__/utils/utilsErrorPaths.test.ts (14 tests): - matchesLabelPattern: middle glob part absent or only inside the tail - assertLabelsExist: wrapped listLabelsForRepo failure - getCurrentLabels: string label entries, wrapped issues.get failure - createCommentOnce: bot marker dedup returns false; human marker ignored - loadProwConfig explicit sources: non-404 getContent wrapped, directory payload is not a file, https fetch network failure wrapped - parseProwConfig: max_request_count against the default request_count labelMatch, labeling, comments: 100% lines/branches; config: 100% lines. Closes #197 Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@hive.kubestellar.io>
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 Hive will automatically remove the |
Contributor
Author
/kind cleanup🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds
__tests__/utils/utilsErrorPaths.test.ts(14 tests) — the only file this PR touches. Covers the seven previously unexercised branches insrc/utils/{labelMatch,labeling,comments,config}.ts:matchesLabelPattern— a middle*part absent between the anchored ends, or present only inside the tail (a*b*bcvsabc)assertLabelsExist— wrappedlistLabelsForRepofailure (could not list the repository labels)getCurrentLabels— plain-string label entries and objects withoutname; wrappedissues.getfailurecreateCommentOnce— returnsfalseand does not POST when a bot comment already carries the marker; a human comment carrying it is ignored and the bot postsloadProwConfigexplicit sources — non-404getContentfailure wrapped; directory / non-stringcontentpayload →is not a file;https://fetchnetwork failure (HttpResponse.error()) wrappedparseProwConfig—max_request_countcompared against the defaultrequest_countof 1All branches are reached through msw; no source, fixture or
dist/changes.Coverage (
npm run test:coverage, origin/main 187c5e3 + this commit):labelMatch.ts,labeling.ts,comments.ts100% lines/branches (were 94.4/96.2/100 lines, 91.7/90/87.5 branches);config.ts100% lines, 99.0% branches (was 98.5/98.1). Overall lines 96.16% → 96.42%, branches 94.55% → 94.94%. Full suite 59 files / 1305 tests green;eslintclean.Disjoint from open PRs #173/#175/#177/#179/#181/#183/#185/#187/#190/#192/#194/#196 (pullReq, issueComment handlers, labels, cronJobs, sleep, trigger, tide, mergeQueue, approve plugin, auth).
Related Issue
Closes #197
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88