Skip to content

test(jobs): backup + misc job files to ≥95% coverage#55

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

test(jobs): backup + misc job files to ≥95% coverage#55
mastermanas805 merged 1 commit into
masterfrom
coverage/worker-jobs-backup-misc-95

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • Drives every listed backup/misc job file in worker/internal/jobs to ≥95% statement coverage.
  • New coverage_gaps_test.go covers the previously-missed Work() error/success branches; backup_extra_test.go + coverage_misc_test.go consolidate prior partial work.
  • geodb.go: geoLite2DownloadURL is now a package var (was const) so the download→extract→rename happy path is testable against httptest; production never reassigns it.

Coverage (statement-level, listed files)

file before after
customer_backup_runner.go ~0/91 96.4%
customer_backup_scheduler.go 94.2 100%
customer_restore_runner.go 87.5 95.6%
backup_s3.go 92.3 96.2%
platform_db_backup.go 91.1 96.2%
platform_db_backup_s3.go 79.7 96.6%
geodb.go 88.1 97.0%
team_deletion_executor.go 89.0 96.0%
real_prober.go 91.0 95.7%
uptime_prober.go 94.7 96.5%
resource_heartbeat.go 94.3 97.1%
propagation_runner.go 96.2%
provisioner_reconciler.go 97.8%
chaos_lease_recovery / team_deletion_s3_adapter / prober 100%

backup_audit.go + audit_kinds.go are const/type-only (no statements).

Test plan

  • make gate green (build + vet + go test ./... -short)
  • full go test ./internal/jobs -count=1 -p 1 passes
  • live backends: docker pg/redis/mongo/nats/minio on 127.0.0.1
  • fixed pre-existing assertion in TestPlatformDBBackup_DumpError_DeletePartialObject

🤖 Generated with Claude Code

Covers Work() error/success branches across the backup, restore,
prober, geodb, team-deletion, and scheduler jobs via sqlmock, an
httptest S3 stub, and the live docker pg/redis/mongo/nats/minio
backends. Each listed job file is now ≥95% statement coverage
(const/type-only files excepted).

geodb.go: geoLite2DownloadURL is now a package var (was const) so the
download→extract→rename happy path can be driven against an httptest
server; production never reassigns it.

Fixed a pre-existing assertion in TestPlatformDBBackup_DumpError_
DeletePartialObject: a dump error propagates through io.Pipe to the
uploader, so the partial-object delete branch is unreachable today —
the test now pins the real failure contract.

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