test(jobs): billing/payment jobs to >=95% coverage#50
Merged
Conversation
Adds billing_coverage_test.go covering every state-machine transition, Razorpay client/breaker mock paths, per-tier arms, and error branches for billing_reconciler, checkout_reconcile, churn_predictor, payment_grace_*, razorpay_webhook_prune, and entitlement_reconciler. Two minimal test seams (churnMetaMarshal / graceReminderMetaMarshal package vars defaulting to json.Marshal) make the otherwise-unreachable defensive marshal-error guards coverable. Remaining sub-100% lines are unreachable ctx-cancellation re-checks and fail-open audit paths. Per-file statement coverage: billing_reconciler 97.7%, checkout_reconcile 96.2%, churn_predictor 100%, payment_grace_reminder 100%, payment_grace_terminator 95.5%, razorpay_webhook_prune 100%, entitlement_reconciler 98.8%. make gate green. 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
billing_coverage_test.godriving every billing/payment job ininternal/jobsto >=95% statement coverage:billing_reconciler.go,checkout_reconcile.go,churn_predictor.go,payment_grace_reminder.go,payment_grace_terminator.go,razorpay_webhook_prune.go,entitlement_reconciler.go.churnMetaMarshal/graceReminderMetaMarshalpackage vars defaulting tojson.Marshal) make the otherwise-unreachable defensive marshal-error guards testable.Per-file statement coverage
Remaining sub-100% lines are unreachable mid-loop ctx-cancellation re-checks and fail-open audit paths.
Test plan
make gate(go build + vet +go test ./... -short -count=1) green, exit 0, zero failuresTestBilling|TestCheckout|TestChurn|TestPaymentGrace|TestRazorpay|TestEntitlementpassesCo-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com