Add integration tests for connecthealth#62
Open
Alan4506 wants to merge 1 commit into
Open
Conversation
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.
Add integration tests for Connect Health
Description of Changes
This PR adds the integration tests for Connect Health under
tests/integration/:conftest.py: session-scoped fixture that creates a Domain, an ACTIVE Subscription, and an S3 bucket, yields(domain_id, subscription_id, output_s3_uri)to the tests, and tears everything down afterwards. The Domain and Subscription waiters are built withbotocore.waiter.create_waiter_with_clientagainst an inlineWaiterModel, since Connect Health does not yet ship built-in waiters.test_non_streaming.py: coversListDomains/GetDomainandListSubscriptions/GetSubscription, asserting on the fields the service is expected to return.test_bidirectional_streaming.py: exercisesStartMedicalScribeListeningSessionend-to-end. It sends aMedicalScribeConfigurationEvent, streamstest.wavaudio at realtime pace, asserts on transcript segments received on the output stream, then callsGetMedicalScribeListeningSessionto verify the session reachesCOMPLETEDstate with the expected configuration round-tripped.assets/test.wav: short 16 kHz / 16-bit / mono PCM medical encounter recording used as the streaming input.Existing limitation
When we tried to build the fixture with the new SDK, we hit the following: when the service omits the
@requiredlastUpdatedAtfield from aCreateSubscriptionOutputresponse, the generated dataclass constructor raisesTypeError, which the SDK pipeline then surfaces assmithy_core.exceptions.SmithyError: CreateSubscriptionOutput.__init__() missing 1 required keyword-only argument: 'last_updated_at'. The Smithy spec defines client error correction for exactly this scenario, but smithy-python has not yet implemented it (although we have tracked this in our backlog). As a result, we cannot use the new SDK to performCreateSubscriptionin fixture setup today; the boto3 client (which tolerates the missing field) is used instead.If we still decide to use the new SDK for resource setup rather than boto3, a workaround would look like the following:
We will revisit the conftest once smithy-python implements client error correction.
Testing
The integration tests create real AWS resources (Domain, Subscription, S3 bucket) under the calling AWS identity, run a live streaming session against the Connect Health service, then delete those resources. The calling identity therefore needs Admin (or equivalent) permissions on ConnectHealth and S3.
Assume an Admin role and export the resulting credentials so the new SDK (which uses
EnvironmentCredentialsResolver) can pick them up:From
clients/aws-sdk-connecthealth/, install the client and test dependencies:Run the tests
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.