Skip to content

test(jobs): quota/storage job coverage to 97.4% aggregate#52

Merged
mastermanas805 merged 1 commit into
masterfrom
coverage/worker-jobs-quota-95
May 22, 2026
Merged

test(jobs): quota/storage job coverage to 97.4% aggregate#52
mastermanas805 merged 1 commit into
masterfrom
coverage/worker-jobs-quota-95

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • Adds internal/jobs/quota_coverage_test.go driving the 6 quota/storage job files to ≥95% (aggregate 97.4%).
  • Per-file: quota.go 100%, storage.go 98.3%, quota_wall_nudge.go 98.2%, quota_redis_eviction.go 96.6%, storage_minio.go 96.4%, quota_infra.go 93.5%.
  • Covers suspend/unsuspend loop error+edge branches, the per-tenant Redis eviction algorithm (empty-token, scan-error, DEL fail-soft, prefix-violation abort, coldest-first delete), wall-nudge axis/query/scan-error paths, and quota_infra mongo connect/RunCommand fail-open plus the seeded success arm.
  • The residual 8 quota_infra.go lines are provably unreachable defensive guards: duplicate-token identifier validation (db_/usr_ share the token, db check fails first) and lib/pq's lazy sql.Open that never errors at Open time.

Test plan

  • go build ./... + go vet ./internal/jobs/ clean
  • go test ./internal/jobs -count=1 -p 1 green (Docker pg/redis/mongo on 127.0.0.1; the unrelated TestPropagation_ForUpdateSkipLockedIntegration is pre-existing and gated on a seeded TEST_DATABASE_URL)
  • Real-infra tests skip gracefully when containers are unreachable

🤖 Generated with Claude Code

Adds quota_coverage_test.go covering the suspend/unsuspend loop error and
edge branches, the per-tenant Redis eviction algorithm (empty-token,
scan-error, DEL fail-soft, prefix-violation abort, coldest-first delete),
the quota-wall-nudge axis/query-error/scan-error paths, and the quota_infra
mongo connect/RunCommand fail-open plus success arm. Per-file: quota.go 100%,
quota_redis_eviction.go 96.6%, quota_wall_nudge.go 98.2%, storage.go 98.3%,
storage_minio.go 96.4%, quota_infra.go 93.5% — aggregate 97.4%. The residual
quota_infra.go lines are provably unreachable defensive guards (duplicate-token
identifier validation; lib/pq's lazy sql.Open never erroring at Open time).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit 3fef280 into master May 22, 2026
10 checks passed
@mastermanas805 mastermanas805 deleted the coverage/worker-jobs-quota-95 branch May 22, 2026 02:14
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