Skip to content

test: raise coverage to ~78%#11

Merged
mastermanas805 merged 1 commit into
masterfrom
coverage/raise-to-95
May 21, 2026
Merged

test: raise coverage to ~78%#11
mastermanas805 merged 1 commit into
masterfrom
coverage/raise-to-95

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • internal/tokens — full Store lifecycle (Load absent + present, Add+Find+Remove+Save roundtrip, FindByTypeNameEnv case-insensitive + empty-env-as-development fallback + empty-type guard, normalize() helper, auto-CreatedAt, storePath HOME resolution, Save bad-path error). Now at 90.8%.
  • internal/secretstore — UseDefault non-clobbering behavior, disabled-keychain branch, MemoryBackend Set("") deletes, keychainBackend Name/Available env-disable path. Bumped to 78.9%.
  • cmd helpers — shortToken (truncate logic), extractTagged (tag scan: request_id / upgrade / EOS / newline / absent-tag), humanMessage preference order.

Coverage: 69.0% → 77.7%. Remaining gap is login pollForTierUpgrade / runUpgrade (live API), root.go Execute + main.go (CLI entrypoint glue), and the OS-keychain Get/Set/Delete branches intentionally excluded by INSTANT_DISABLE_KEYCHAIN so test runs don't pollute the dev keychain.

Test plan

  • go test ./... -short -coverprofile=cov.out -covermode=atomic
  • All packages green
  • No production source modified — only _test.go additions

🤖 Generated with Claude Code

Adds 3 test files covering:
- internal/tokens: Load (absent + present), Add+Find+Remove+Save roundtrip,
  FindByTypeNameEnv (case-insensitive type+name, empty-env-as-development
  fallback, empty-type guard), normalize() helper, auto-CreatedAt stamping,
  Save bad-path error, storePath() HOME resolution
- internal/secretstore: UseDefault non-clobbering of existing backend,
  UseDefault with disabled keychain returns nil, keychainBackend
  Available() env-disable path, Name() label, MemoryBackend Set("")
  deletes
- cmd: shortToken truncate logic, extractTagged tag-scan (request_id,
  upgrade, end-of-string, newline-terminator, absent-tag), humanMessage
  preference order (message > agent_action > code > empty)

Coverage: 69.0% -> 77.7%. Remaining gap is cmd/login.go pollForTierUpgrade
+ runUpgrade (require live API), cmd/root.go Execute + main.go (CLI
entrypoint glue), and secretstore/secretstore.go Get/Set/Delete against
the real OS keychain (intentionally excluded by INSTANT_DISABLE_KEYCHAIN
in tests to avoid touching the dev keychain).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit 7ee9235 into master May 21, 2026
9 checks passed
@mastermanas805 mastermanas805 deleted the coverage/raise-to-95 branch May 21, 2026 19:16
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