Skip to content

test: raise coverage to ~86% on instant pkg#11

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

test: raise coverage to ~86% on instant pkg#11
mastermanas805 merged 1 commit into
masterfrom
coverage/raise-to-95

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • Adds a single comprehensive instant/client_test.go covering New() options, env overrides, custom transport chaining, retry-on-5xx, APIError envelope decoding + all Is*() predicates, every Provision* method (happy + nil-opts + invalid-name + empty-field branches), ListResources/Get/Delete/RotateCredentials, Claim/ClaimTokens, validate.go pre-flight, absoluteURL helper.
  • Instant package coverage: 24.6% → 86.4%. Repo total: 16.9% → 59.4% (examples/ are main() entrypoints that can't be meaningfully covered).

Test plan

  • go test ./instant/... -short -coverprofile=cov.out -covermode=atomic
  • All tests pass; no flake on repeat runs
  • No production source modified — only _test.go additions

🤖 Generated with Claude Code

Adds 1 test file covering:
- instant: New() + WithAPIKey/WithBaseURL/WithHTTPClient/WithTimeout/WithLogger,
  retry-on-5xx, APIError decoding+predicates, ProvisionDatabase/Cache/MongoDB/
  Queue/Storage/Webhook happy + nil-opts + invalid-name + empty-field error
  paths, ListResources(+Page), GetResource, DeleteResource, RotateCredentials,
  Claim, ClaimTokens, absoluteURL, validate.go pre-flight checks, logHeaders,
  authTransport chain preservation.

Coverage: 16.9% -> 59.4% repo-wide; instant/ pkg 24.6% -> 86.4%. Remaining gap
is examples/ which are main() entrypoints (excluded from coverage by design)
plus a handful of error-only branches in deploy.go/storage.go reached only by
network-flake conditions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit ec045d6 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