Skip to content

test(cmdregistry): cover the branches under the 96% floor (D-1485) - #968

Merged
acamarata merged 1 commit into
mainfrom
dw3-cli-2
Oct 26, 2026
Merged

acamarata merged 1 commit into
mainfrom
dw3-cli-2

Conversation

@acamarata

Copy link
Copy Markdown
Collaborator

Fixes the red Coverage workflow (run 40321895084): covfloor reported internal/cmdregistry at 95.0% against a 96% floor.

Adds internal/cmdregistry/branches_test.go with behaviour assertions for the uncovered branches:

  • EffectiveJSON (was 0%): no override, unset override flag, legacy/none override, none beats legacy, nil command
  • bracketed / parseArgs with an unclosed bracket and nested brackets
  • Build with nil root / nil canon; unresolved V15OnlyEnvelope path
  • v1.4 builtin plugin mount keeps its pre-split canon classification and has no plugin identity
  • validateConfirm problems: not runnable, duplicate/empty flag, plan without flag/id_flag
  • warnPlugin warns once per slug; invalid plugin confirm JSON is dropped with an E437 warning
  • ApplyFlagEnv with a nil registry

The floor is unchanged; no nolint or exclusions.

Commands run and results

  • go test -mod=vendor -coverprofile=c.out ./internal/cmdregistry/: 85 passed, coverage 95.0% -> 99.6%
  • go run -mod=vendor ./tools/covfloor -profile c.out -floors .github/coverage-floors.txt: PASS internal/cmdregistry 99.6% floor 96% (package-only profile, so not run with -strict; the full-repo profile runs in CI)
  • gofmt -l and go vet -mod=vendor on the package: clean

Not covered: the encode-error branch in Registry.Marshal (needs an unencodable value).

Adds behaviour tests for EffectiveJSON, unclosed brackets in Use strings, Build input validation, unresolved V15OnlyEnvelope paths, v1.4 builtin mounts, confirm validation problems and once-per-slug plugin warnings. Package coverage 95.0% -> 99.6%.
@acamarata
acamarata merged commit 0a873b9 into main Oct 26, 2026
32 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant