Skip to content

fix(database): align delete fixtures + test to the d0123460 lifecycle - #186

Merged
chmmou merged 1 commit into
mainfrom
fix/database-delete-fixture-narrative
May 20, 2026
Merged

fix(database): align delete fixtures + test to the d0123460 lifecycle#186
chmmou merged 1 commit into
mainfrom
fix/database-delete-fixture-narrative

Conversation

@chmmou

@chmmou chmmou commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

The add/get/update fixtures all narrate the lifecycle of a single hypothetical database d0123460. The delete fixtures (request + response echo) were the lone outlier — both showed d0123456 — and TestClientDelete tracked them. Harmless at runtime (FakeCaller stubs the call) but broke the slice-wide narrative.

  • testdata/database/delete_database_request.xml: database_logind0123460; auth envelope placeholders → REDACTED to match the other request fixtures.
  • testdata/database/delete_database_response_success.xml: request-echo + success message → d0123460.
  • internal/database/write_test.go::TestClientDelete: track the new fixture login.

The list fixture (get_databases_response_success.xml, 5 entries d0123456..d0123460) is intentionally unchanged; the read tests assert against the first entry (d0123456) by index, which remains correct.

The add/get/update fixtures all narrate the lifecycle of a single
hypothetical database d0123460 (created by add_database, queried via
get_databases with database_login filter, mutated by update_database).
The delete fixtures were the lone outlier — request + response echo
both showed d0123456 — and the matching TestClientDelete called
Delete(..., "d0123456") to track them. The mismatch was harmless at
runtime (the FakeCaller stubs the call before any fixture lookup) but
broke the slice-wide narrative: a reader skimming testdata/database/
saw d0123460 in five files and d0123456 in two without an obvious
why.

The delete request + response are now aligned to d0123460, and
TestClientDelete tracks them — the whole testdata/database/ set now
tells one continuous add → get → update → delete story for a single
database. The list fixture (get_databases_response_success.xml) is
intentionally unchanged: it covers five entries d0123456..d0123460,
and the read tests assert against the first one (d0123456) by index,
which remains correct.

Also normalises the request envelope's auth placeholders
({{kas_auth_data_session}}/…/{{kas_login}}) to the same redacted
form the other database request fixtures use, so the captured
request shape is consistent across the slice.
@chmmou
chmmou merged commit 147f67b into main May 20, 2026
6 checks passed
@chmmou
chmmou deleted the fix/database-delete-fixture-narrative branch May 20, 2026 19:59
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