test: raise coverage to ~78%#11
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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_KEYCHAINso test runs don't pollute the dev keychain.Test plan
go test ./... -short -coverprofile=cov.out -covermode=atomic_test.goadditions🤖 Generated with Claude Code