Repository navigation
Add HTTP recording to smithy-test - #986
Merged
Merged
Conversation
kuhe
force-pushed
the
kuhe/feat/http-record
branch
9 times, most recently
from
November 24, 2026 18:28
f378b00 to
db011ba
Compare
kuhe
force-pushed
the
kuhe/feat/http-record
branch
2 times, most recently
from
November 24, 2026 18:55
cd43b33 to
419cd8a
Compare
kuhe
force-pushed
the
kuhe/feat/http-record
branch
from
November 24, 2026 19:19
419cd8a to
2e24ed5
Compare
kuhe
marked this pull request as ready for review
November 24, 2026 20:27
Alan4506
approved these changes
Nov 24, 2026
jonathan343
approved these changes
Nov 24, 2026
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.
This PR adds a smithy-test API called
instrumentfor recording and playing back live-service integration tests as functional http mock tests.For an example, see aws/aws-sdk-python#154.
Data streams are supported (S3), but event streams are not supported in this PR.
Usage
We got
controller = mock(client)in #917, now we getinstrument(client).By instrumenting your client, it can then run in two modes:
SMITHY_PYTHON_TEST_MODE=record- this modes writes the operation responses as Python code into the recordings path. You can review and commit these.SMITHY_PYTHON_TEST_MODE=playback- (default) this uses the recordings to mock the http responses, allowing the same test to execute offline.Both modes honor assertions made in the written tests.
Write your test once, record it to get an honest server mock response, and then have a durable offline test.