Integration tests for pkg/godaddy/ client #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Depends on #3 (Go scaffold + DNS client, merged as PR #5). Tests prove the client works against the live GoDaddy API before provider wiring. Should land after #6 (QA nits: DomainID type fix, io.ReadAll limit, url naming) to avoid writing tests against stale types.
Repo
ldraney/godaddy-tofuUser Story
As a provider developer
I want integration tests that prove pkg/godaddy/ methods work against the live API
So that I can trust the client layer before building provider resources on top of it
Context
Integration tests run against the live GoDaddy API using production credentials from
~/secrets/godaddy/.env. Tests should be gated behind a build tag or env var so they don't run in CI without credentials.DNS tests are P0 — must prove read, write, and delete of A records on a real domain. Domain tests are P1 — must prove list and get. All tests should be non-destructive where possible (read existing records, create test records, clean up after).
Rate limit: API returns 429 with
retryAfterSec. Tests should implement a test-only retry helper that sleeps and retries on 429 — this is NOT client-level retry logic (that's a separate concern), just a test utility to avoid flaky failures.File Targets
pkg/godaddy/client_test.go— test helpers (env var client instantiation, 429 retry helper), client instantiation testspkg/godaddy/dns_test.go— DNS integration tests covering all 6 methods:TestGetRecords— read existing A records for a known domainTestAddAndDeleteRecords— create test TXT records viaAddRecords, verify they exist viaGetRecords, delete viaDeleteRecordsTestReplaceRecords— replace a test TXT record by type+name, verify, clean upTestReplaceRecordsByType— replace all TXT records for domain, verify, clean upTestReplaceAllRecords— snapshot existing records, replace all, restore original (use with caution, test on safe subdomain)pkg/godaddy/domains_test.go— domain integration tests:TestListDomains— list all domains, verify non-emptyTestGetDomain— get a specific domain, verify fields populatedFeature Flag
None.
Acceptance Criteria
GODADDY_API_KEY=... GODADDY_API_SECRET=... go test ./pkg/godaddy/ -vpassest.Skip)Test Expectations
Constraints
testing.Short()or env var gate — tests must not run without credentialspalinks.app)t.Cleanup)Checklist
Related
project-godaddy-tofudocs/dns-endpoints.md— endpoint referencedocs/auth.md— credential setupScope Review: NEEDS_REFINEMENT
Review note:
review-1425-2026-06-14Ticket is well-structured with all template sections present, but has 5
[BODY]fixes and 2[SCOPE]gaps to resolve before moving to next_up.Issues found:
TestAddAndDeleteRecord(singular) but method isAddRecords(plural, takes[]DNSRecordslice)ReplaceAllRecordsandReplaceRecordsByTypeare unaddressedstory-godaddy-tofu-dns-iacandarch-godaddy-tofunotes don't exist in pal-e-docs (project page links to the story but note was never created)Scope refinement applied (review-1425-2026-06-14):
TestAddAndDeleteRecord→TestAddAndDeleteRecordsto matchAddRecordsmethod signatureTestReplaceRecordsByTypeandTestReplaceAllRecordsto cover all 6 DNS methods (was 4 of 6)float64DomainIDScope Review: APPROVED
Review note:
review-1425-2026-06-14-r2Re-review after refinement. All 5 body fixes from the prior review have been applied and verified against the codebase. Ticket is ready for next_up.
Verified:
dns.gosignatures)_test.gofiles inpkg/godaddy/)Remaining [SCOPE] items (docs-level, not ticket blockers):
story-godaddy-tofu-dns-iacin pal-e-docsarch-godaddy-tofuin pal-e-docs