Skip to content

test(coverage): drive plans + quota to ≥95%#138

Merged
mastermanas805 merged 1 commit into
masterfrom
coverage/api-plans-quota-95
May 21, 2026
Merged

test(coverage): drive plans + quota to ≥95%#138
mastermanas805 merged 1 commit into
masterfrom
coverage/api-plans-quota-95

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • internal/plans: 92.9% → 100.0%. Cover Rank() (was 0%) — total-order ladder, unknown-tier sentinel (-1), yearly-not-auto-normalised, strict-increasing invariant.
  • internal/quota: 82.5% → 95.0%. Cover the fail-open error branches the integration suite skips:
    • CheckAndIncrementToken Redis-down pipeline error
    • GetThroughputCount Redis error
    • CheckStorageQuota closed-DB error (fail-open contract)
    • UpdateStorageBytes closed-DB error (does NOT fail open — caller retries)
    • LimitBytes MB→bytes conversion + unlimited sentinel (P2 regression surface 2026-05-17)

Uses miniredis (already in go.mod) for offline Redis-down simulation; no new deps.

Test plan

🤖 Generated with Claude Code

- internal/plans: cover Rank() (was 0%) — total-order, unknown-tier sentinel,
  yearly-not-auto-normalised, strict-increasing ladder invariant. Package
  now at 100.0% (was 92.9%).

- internal/quota: cover the error/fail-open branches that the integration
  suite skips — Redis-down pipeline error in CheckAndIncrementToken,
  redis-error in GetThroughputCount, closed-DB error in CheckStorageQuota
  (fail-open) and UpdateStorageBytes (does NOT fail open). Also lock the
  LimitBytes MB→bytes conversion + unlimited sentinel (P2 regression
  surface 2026-05-17). Package now at 95.0% (was 82.5%).

Both use miniredis (already in go.mod) for offline Redis-down simulation;
no new deps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit 8e02cba into master May 21, 2026
11 checks passed
@mastermanas805 mastermanas805 deleted the coverage/api-plans-quota-95 branch May 21, 2026 19:40
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