test(jobs): deploy-lifecycle workers to 95.8% coverage#49
Merged
Conversation
Adds deploy_lifecycle_coverage_test.go covering the deploy-lifecycle worker surface: status reconcile (autopsy per-tick cap/defer, k8s clientset constructor error path), failure autopsy (pod-log success + error branches, current-terminated Error reason, oversize-event truncation, scanner partial-read), notify webhook (cursor read/write failures, empty batch, transient-DNS hold, SSRF-reject + no-webhook cursor-advance errors, delivery-failed audit-insert error, fetchBatch rows.Err, real pinned dial), deployment expirer (rows.Err, async audit DB error), and deployment reminder (full sweep with CAS skip + hours floor, scan error, rows.Err, CAS RowsAffected error). Per-file statement coverage now: expirer/reminder/orphan_canceler 100%, status_reconcile 95.2%, notify_webhook 93.0%, autopsy 91.4%, orphan_reconciler 97.7% — 95.8% across the seven target files. Remaining gaps are production k8s-clientset wrappers and defensive json.Marshal-of-primitive paths that require a live cluster. Test-only change. `make gate` (build + vet + go test ./... -short) 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
internal/jobs/deploy_lifecycle_coverage_test.godriving the seven deploy-lifecycle worker files to 95.8% statement coverage (was ~68% package-wide; these files were the long tail).Per-file statement coverage
Remaining uncovered lines are production
*kubernetes.Clientsetwrappers (require a live cluster),net.LookupIP, and defensivejson.Marshal-of-primitive paths that cannot fail.Test plan
go build ./...greengo vet ./...greengo test ./... -short -count=1green (make gate)go test ./internal/jobs -run 'TestDeploy|TestOrphan|TestReminder|TestExpirer'green🤖 Generated with Claude Code