fix(database): align delete fixtures + test to the d0123460 lifecycle - #186
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 showedd0123456— andTestClientDeletetracked them. Harmless at runtime (FakeCaller stubs the call) but broke the slice-wide narrative.testdata/database/delete_database_request.xml:database_login→d0123460; auth envelope placeholders →REDACTEDto 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 entriesd0123456..d0123460) is intentionally unchanged; the read tests assert against the first entry (d0123456) by index, which remains correct.