Skip to content

test: pin default/fallback arms in watch, Classifier, and run-dir - #231

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-default-fallbacks
Oct 12, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-default-fallbacks

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds test/default-fallbacks.test.js, pinning the optional-argument default arms that the existing suite never reaches because every caller sets the value explicitly:

  • watch() without cli classifies with the claude pattern set
  • Classifier.classify('') returns null and consumes no sequence number
  • state_change events omit data.cli when the pattern set has no cli name (with a named-set control)
  • defaultRunDir() falls back to pluk-user where process.getuid is absent (Windows)
  • rotateLogFileIfNeeded() leaves an oversized log untouched when it has no more than keepLines lines

Test-only; no src/ changes, so no changelog fragment.

Coverage (npm test, Node 26, 328 tests pass)

file branches before after
classifier.js 97.26% 100%
run-dir.js 95.31% 100%
watch.js 96.55% 100%
all files 96.67% 97.85%

Remaining untaken branches are unreachable in-process (process.argv[1] ?? '', lines.pop() ?? ''), already documented as platform-only (attach.ts darwin arm), or require an empty bundled patterns/ dir (cli.ts || 'none' fallbacks).


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

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

Cover the optional-argument defaults every caller in the suite already
sets explicitly: watch() without cli, Classifier.classify(''), the
state_change cli tag with an unnamed pattern set, defaultRunDir() where
process.getuid is absent, and rotateLogFileIfNeeded() on an oversized
log with no more than keepLines lines. Branch coverage 96.67% -> 97.85%;
classifier.js, run-dir.js and watch.js reach 100% branches.

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

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 12, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 0187669 into main Oct 12, 2026
12 of 13 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-default-fallbacks branch October 12, 2026 16:34
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants