prove one service over both transports with a hand-driven harness - #284
Merged
Merged
Conversation
One DocumentService asking for both transports, one implementation serving both unmodified: a header-bound request-reply operation with a complete error mapping, a no-payload operation overriding its status, a bytes operation with a query field, a defaulted operation, and a one-way operation. The http halves join through an in-memory plain-terms loop, the amqp halves through the headers-capable seam, and an installed fault handler is observed answering its own statuses, headers and payloads against the defaults. One test documents a defect the loop exposed rather than hiding it: a unit success carried over the amqp envelope decodes as a missing value - serde writes the unit as null inside the envelope's optional value and the reader answers a fault where Ok(()) was sent. The test asserts today's wrong behavior so the fix cannot land without flipping it.
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.
New test binaries only — nothing under
src/changes.One
DocumentServicedeclaring both transports, one implementation proven (by pointer identity) to serve both loops unmodified. Coverage per operation shape on both loops: header-bound request-reply with both mapped errors, no-payload with a 202 override, bytes with a query field, the annotation-free default binding, and one-way delivery. ARecordingFaultHandleranswers 490/491 with its own headers and body, verified against the 404/400 defaults to prove the seam is used.The loop also exposed a real defect in the published surface:
Ok(())carried over the AMQP envelope decodes as a missing value (Some(())serializes tonullinsideOption<T>, which reads back asNone), so the client faults where unit success was sent. One test documents the wrong behavior explicitly and fails the moment it is fixed — the fix is filed as its own task.Gate:
just lintandjust test-named-featuresgreen (18/18 under each serde-enabled combination).