Skip to content

test(resolver): cover the ENOTDIR readdir guards in the ** glob walk - #341

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-resolver-starstar-enotdir
Oct 25, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-resolver-starstar-enotdir

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

#337 and #340 added descendantDirs() and filesIn() to the ** glob walk in src/resolver.ts. Each swallows a readdirSync failure and treats the base as empty, but neither catch arm was reached by any test — npm run test:coverage at e7824e1 reports resolver.js at 98.17% lines with 64-65 81-82 uncovered (both guards).

This adds one test: a trailing ** under a regular file (leaf.txt/**). readdir on a file throws ENOTDIR in both helpers, deterministically and without chmod, and the test pins that the pattern resolves to the file itself rather than throwing.

After: resolver.js 100% lines, 474 tests pass, overall 99.60% lines / 97.12% branches (gate 98/96/100). dist/ rebuilt and committed per the dist-sync CI check; changelog fragment added.

No open issue — found during a routine coverage sweep of the two resolver commits.


Filed by quality agent (ACMM L4/L6 — full mode)

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

Both descendantDirs() and filesIn() (added in #337/#340) swallow a
readdir failure and treat the base as empty, but no test reached either
catch arm. A trailing ** under a regular file triggers ENOTDIR in both,
deterministically and without chmod, and pins that the pattern resolves
to the file itself.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 25, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 25, 2026
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 25, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed — no findings from this perspective.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks correct to me — test-only change, verified against the tree at 89b5fc8.

What I checked

  • src/resolver.ts:117-120: the literal segments of ${file}/** resolve via existsSync, so bases is [leaf.txt] when the trailing ** is reached.
  • src/resolver.ts:113-115: trailing ** calls descendantDirs(file) and filesIn(file); both readdirSync on a regular file throw ENOTDIR and hit the catch arms at resolver.ts:79 and resolver.ts:95, returning empty. next is therefore [file], matching the assertion at src/resolver.test.ts:272.
  • Ran it locally: the new test passes; npm run test:coverage reports resolver.js at 100% lines (both previously-uncovered guards now exercised).
  • npm run build then git status --porcelain -- dist/ is empty, so the committed dist/ satisfies the dist-sync CI check.
  • Fragment name changelog.d/added-resolver-starstar-enotdir-test.md matches the existing added-* convention in that directory.

Deterministic (no chmod, no platform-dependent permission tricks), and CI is green across all six Node/OS matrix cells. No findings.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 1cfe832 into main Oct 25, 2026
14 of 15 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-resolver-starstar-enotdir branch October 25, 2026 20:53
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#34189b5fc8` sha256:5ec556e10ff97785ecd55bfb411cbff287694f1725fab42b577c91724c3e8d4d — download from the dashboard or `hivectl review evidence #341`.

@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed — no findings from this perspective.

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

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants