Skip to content

test: increase unit test coverage #299

Merged
Ratler merged 11 commits intomasterfrom
feat/unit-test-coverage
Feb 17, 2026
Merged

test: increase unit test coverage #299
Ratler merged 11 commits intomasterfrom
feat/unit-test-coverage

Conversation

@Ratler
Copy link
Member

@Ratler Ratler commented Feb 17, 2026

No description provided.

Ratler and others added 10 commits February 17, 2026 21:54
…tions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…, and backup codes

Security boundary tests covering:
- Combined auth: empty/malformed headers, SQL injection, bearer edge cases,
  expiration boundaries, oversized keys, concurrent requests, IP restriction
  edge cases, and deleted key behavior documentation
- Backup codes: adversarial input validation, normalization edge cases,
  corrupt metadata handling, concurrent consumption safety, TOCTOU race
  documentation, and coverage for GetBackupCodesCount/GeneratedAt/ReadStatus

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Boundary tests covering:
- Adversarial token inputs (empty, oversized, SQL injection, unicode, null bytes)
- GetTokenTimeRemaining edge cases (ExpiresAt=0, int32 max, exact-now)
- MaxTokensPerUser boundary (N-1 no invalidation, N triggers, N+1 triggers)
- Token reuse attempts, concurrent access safety
- Custom token length validation, cancelled context handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codacy-production
Copy link

codacy-production bot commented Feb 17, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+6.95%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7cb9c68) 18920 8272 43.72%
Head commit (36ea60d) 18920 (+0) 9586 (+1314) 50.67% (+6.95%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#299) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@Ratler Ratler changed the title test : increase unit test coverage test: increase unit test coverage Feb 17, 2026
- Fix gofmt formatting (struct alignment) in 4 files
- Rename newValidApiKeyRow to newValidAPIKeyRow (Go naming convention)
- Replace unused test parameters with _ in business_metrics_test.go
@Ratler Ratler merged commit 1ba5cb0 into master Feb 17, 2026
9 checks passed
@Ratler Ratler deleted the feat/unit-test-coverage branch February 17, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant