Description
Follow-up from #20. That bug caused dnsimple domains ds-records create to exit 1 and print Error: Failed to create DS record. Please contact support while the record was actually being persisted server-side. The underlying cause was fixed in the API, but the CLI itself has no test that would catch a future recurrence of the same exit-code-vs-side-effect divergence on this command.
The CLI is a thin wrapper (internal/cli/domains_ds_records.go, newDsRecordsCreateCmd) that simply propagates errors from c.Domains.CreateDelegationSignerRecord(...). A small integration-style test that exercises the happy path (stubbed or sandbox-backed) and asserts exit code 0 with no Error: line on stderr would have caught the original regression immediately and would protect the next DS-records callers (automation, CI scripts) from silent exit-code breakage.
Expected Behavior or Outcome
- A regression test exists for the
ds-records create command that fails if the command exits non-zero on a successful create.
- The test runs in CI on every PR.
- The test is written in a style that is straightforward to replicate for the sibling DS-records subcommands (
list, delete) if they gain similar coverage later.
Acceptance Criteria
Resources/References
Notes
Exit-code correctness is the load-bearing property here. The assertion does not need to validate output formatting beyond "no error line"; stricter assertions on the exact stdout shape can live in a separate, more focused test.
Description
Follow-up from #20. That bug caused
dnsimple domains ds-records createto exit1and printError: Failed to create DS record. Please contact supportwhile the record was actually being persisted server-side. The underlying cause was fixed in the API, but the CLI itself has no test that would catch a future recurrence of the same exit-code-vs-side-effect divergence on this command.The CLI is a thin wrapper (
internal/cli/domains_ds_records.go,newDsRecordsCreateCmd) that simply propagates errors fromc.Domains.CreateDelegationSignerRecord(...). A small integration-style test that exercises the happy path (stubbed or sandbox-backed) and asserts exit code0with noError:line on stderr would have caught the original regression immediately and would protect the next DS-records callers (automation, CI scripts) from silent exit-code breakage.Expected Behavior or Outcome
ds-records createcommand that fails if the command exits non-zero on a successful create.list,delete) if they gain similar coverage later.Acceptance Criteria
dnsimple domains ds-records createagainst a stubbed/fake DNSimple API that responds with a 2xx and a valid DS record body, and asserts the command exits with code0.Error:is emitted on stderr for the happy path.go test ./...(or equivalent CI invocation) and does not require any out-of-band setup beyond what other CLI tests already require.Resources/References
internal/cli/domains_ds_records.go(newDsRecordsCreateCmd)Notes
Exit-code correctness is the load-bearing property here. The assertion does not need to validate output formatting beyond "no error line"; stricter assertions on the exact stdout shape can live in a separate, more focused test.