test: raise coverage over 95% to clear patch-coverage gate#14
Merged
Conversation
Adds branch-level unit tests for the cheapest previously-uncovered paths across all four packages, lifting cmd 78.1%->82.0%, cliconfig 76.6%->81.2%, tokens 90.8%->92.3% (statement coverage; codecov line coverage clears 95%). - cmd/coverage_units_test.go: ExitCodeError nil/zero receivers, withExitCode nil pass-through, errAuthRequired empty-detail default, parseAPIError 402/429/5xx/4xx + empty/non-JSON/legacy-upgrade branches, classifyError DNS/OpError/generic-url/session-phrase arms, parseResourceFilters + matchResourceFilters + lower/eqFold, deploy_stub mcpAliasFor/curlHintFor default arms. - cmd/coverage_login_test.go: createCLISession + pollForAuthCompletion success/error/malformed branches via httptest (no real network); up.go truncate/apiResourceType/shortToken/webhookReceiveURL. - internal/cliconfig/coverage_test.go: SecretBackendName branches, Load resolution from secretstore/fallback/parse-error, Save logout-clears-store, Clear idempotency. - internal/tokens/coverage_test.go: Load existing-file round-trip + parse error. All CI-safe (httptest + temp HOME + in-memory secret backend). Existing suite stays green under -race. 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
HOME, and the in-memory secret backend (no real network or OS keychain).What's covered
cmd:ExitCodeErrornil/zero receivers,withExitCodenil pass-through,errAuthRequireddefault detail,parseAPIError402/429/5xx/4xx + empty/non-JSON/legacy-upgrade arms,classifyErrorDNS/OpError/generic-url/session arms,parseResourceFilters/matchResourceFilters/lower/eqFold,deploy_stubdefault arms,createCLISession/pollForAuthCompletionsuccess/error/malformed branches,up.gotruncate/apiResourceType/shortToken/webhookReceiveURL.cliconfig:SecretBackendNamebranches,Loadresolution (secretstore/fallback/parse-error),Savelogout-clears-store,Clearidempotency.tokens:Loadexisting-file round-trip + parse error.Test plan
go build ./...go vet ./...go test ./... -race -count=1(all green)go test ./... -short -coverprofileregenerated — every package up, none down