Skip to content

test: achieve 97% coverage and remove avatar feature#10

Merged
sofq merged 4 commits intomainfrom
chore/coverage-100-remove-avatar
Mar 29, 2026
Merged

test: achieve 97% coverage and remove avatar feature#10
sofq merged 4 commits intomainfrom
chore/coverage-100-remove-avatar

Conversation

@sofq
Copy link
Copy Markdown
Owner

@sofq sofq commented Mar 29, 2026

Summary

  • Raise test coverage from 75.9% → 97.4% across all packages (remaining 2.6% is structurally unreachable dead code)
  • Add codecov.yml to exclude auto-generated cmd/generated/ (18K lines) and main.go from Codecov reporting — previous Codecov score was 17.95% due to these
  • Remove internal/avatar package and cf avatar command (unused writing style profiler feature)

Coverage by package

Package Before After
gen 98.1% 100%
internal/audit 85.7% 100%
internal/cache 95.7% 100%
internal/config 77.5% 100%
internal/diff 94.6% 100%
internal/errors 72.7% 100%
internal/jq 91.7% 100%
internal/policy 100% 100%
internal/client 49.6% 95.9%
internal/oauth2 71.8% 97.7%
internal/template 86.3% 98.9%
cmd/gendocs 86.4% 97.3%
cmd 60.4% 79.0%

Test plan

  • All 16 packages pass (go test ./...)
  • No compilation errors or vet warnings
  • CI passes with Codecov upload
  • Verify cf avatar command no longer appears in help output

sofq added 2 commits March 29, 2026 22:18
- Add comprehensive tests across all packages to raise coverage from
  75.9% to 97.4% (remaining 2.6% is structurally unreachable dead code)
- Add codecov.yml to exclude auto-generated cmd/generated/ and main.go
  from coverage reporting (18K lines dragging Codecov to 17.95%)
- Remove internal/avatar package and cf avatar command (unused feature)
- Remove avatar docs and sidebar entry

Package coverage: audit 100%, cache 100%, config 100%, diff 100%,
duration 100%, errors 100%, jq 100%, jsonutil 100%, policy 100%,
gen 100%, client 95.9%, oauth2 97.7%, template 98.9%, gendocs 97.3%,
cmd 79.0%
Already in .gitignore but was still tracked. Files remain on disk.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

sofq added 2 commits March 29, 2026 22:22
TestOpenBrowserCurrentOS was calling the real openBrowser() which
runs `open https://example.com` on macOS, launching the user's browser.
Mock the function instead.
@sofq sofq merged commit 873aa68 into main Mar 29, 2026
15 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