test(tpagectl): close tests-lump audit gaps #635

Merged
fuzzy merged 1 commit from test/issue-tests into main 2026-08-11 15:49:02 +00:00
Owner

Batch for the tpagectl tests lump of the auditor issues.

  • Shared helpers (#561, #565): new clierr.IsNotFound/clierr.NotFoundf centralize the 404-to-KindNotFound mapping, and output.RenderFormat centralizes the --format dispatch (json/yaml/table + validation error). The site package now reuses them in siteNotFound; the five inline 404 blocks in deployment (get/list/rollback/promote) collapse to one-liners.
  • Flag precedence (#541): TestConfigFlagOverridesFile asserts --server/--token beat an explicit --config file.
  • resolveToken (#593): table-driven TestResolveToken covers config-wins, keychain fallback, empty, unavailable, not-found, and genuine-error propagation. (The credentials package itself already has unit tests from the #588 pass.)
  • site get passthrough (#554): TestSiteGetNon404Passthrough asserts a 500 propagates as the raw *client.HTTPError without the not-found wrapper.
  • deployment list edges (#566): TestListInvalidFormat (rejects --format xml) and TestListLimitBeyondResults (--limit larger than the set).
  • deployment rollback passthrough (#571): TestRollbackNon404Passthrough.
  • delete-preview 204 (#578): TestDeletePreviewHandlerNoContent covers the nil-deployment/no-error branch (fake extended with delPreviewNil).

Closes #541, #554, #566, #571, #578, #593, #561, #565.

Batch for the tpagectl tests lump of the auditor issues. - **Shared helpers** (#561, #565): new `clierr.IsNotFound`/`clierr.NotFoundf` centralize the 404-to-`KindNotFound` mapping, and `output.RenderFormat` centralizes the `--format` dispatch (json/yaml/table + validation error). The site package now reuses them in `siteNotFound`; the five inline 404 blocks in `deployment` (get/list/rollback/promote) collapse to one-liners. - **Flag precedence** (#541): `TestConfigFlagOverridesFile` asserts `--server`/`--token` beat an explicit `--config` file. - **resolveToken** (#593): table-driven `TestResolveToken` covers config-wins, keychain fallback, empty, unavailable, not-found, and genuine-error propagation. (The `credentials` package itself already has unit tests from the #588 pass.) - **site get passthrough** (#554): `TestSiteGetNon404Passthrough` asserts a 500 propagates as the raw `*client.HTTPError` without the not-found wrapper. - **deployment list edges** (#566): `TestListInvalidFormat` (rejects `--format xml`) and `TestListLimitBeyondResults` (`--limit` larger than the set). - **deployment rollback passthrough** (#571): `TestRollbackNon404Passthrough`. - **delete-preview 204** (#578): `TestDeletePreviewHandlerNoContent` covers the nil-deployment/no-error branch (fake extended with `delPreviewNil`). Closes #541, #554, #566, #571, #578, #593, #561, #565.
test(tpagectl): close tests-lump audit gaps
Some checks failed
CI / docker (push) Failing after 59s
CI / build (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
CI / build (push) Has been cancelled
CI / test (pull_request) Has been cancelled
CI / test (push) Has been cancelled
CI / lint (push) Has been cancelled
7ed88feec2
* add clierr.IsNotFound / clierr.NotFoundf shared helpers and
  output.RenderFormat for the --format dispatch; site and deployment now
  reuse them instead of inlining 404 mapping and format switches (#561, #565)
* test flag-over-file config precedence (#541)
* test resolveToken precedence and error paths (#593)
* test site get non-404 error passthrough (#554)
* test deployment list invalid format and --limit edge (#566)
* test deployment rollback non-404 error passthrough (#571)
* test delete-preview handler 204 branch (#578)

Closes #541, #554, #566, #571, #578, #593, #561, #565
fuzzy force-pushed test/issue-tests from 7ed88feec2
Some checks failed
CI / docker (push) Failing after 59s
CI / build (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
CI / build (push) Has been cancelled
CI / test (pull_request) Has been cancelled
CI / test (push) Has been cancelled
CI / lint (push) Has been cancelled
to 86f63d9963
All checks were successful
CI / build (pull_request) Successful in 4m3s
CI / docker (pull_request) Successful in 3m6s
CI / lint (pull_request) Successful in 4m58s
CI / test (pull_request) Successful in 19m23s
CI / build (push) Successful in 9m38s
CI / lint (push) Successful in 15m23s
CI / test (push) Successful in 17m24s
CI / docker (push) Successful in 28m11s
2026-08-11 12:36:02 +00:00
Compare
fuzzy merged commit 86f63d9963 into main 2026-08-11 15:49:02 +00:00
fuzzy deleted branch test/issue-tests 2026-08-11 15:49:02 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd!635
No description provided.