-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add URI S3 Client unit tests #2901
Conversation
@@ -40,6 +40,7 @@ def main(): | |||
"aws-cpp-sdk-dynamodb-integration-tests", | |||
"aws-cpp-sdk-sqs-integration-tests", | |||
"aws-cpp-sdk-s3-integration-tests", | |||
"aws-cpp-sdk-s3-unit-tests", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im adding to the run integ tests right now. likely this should be a completely seperate step in our CI, and we should have other clients in it. We can create a seperate sep once we have enough client unit tests to justify it.
//We have to mock requset because it is used to create the return body, it actually isnt used. | ||
auto mockRequest = Aws::MakeShared<Standard::StandardHttpRequest>(ALLOCATION_TAG, "mockuri", HttpMethod::HTTP_GET); | ||
mockRequest->SetResponseStreamFactory([]() -> IOStream* { | ||
IOStream* stream = Aws::New<StringStream>(ALLOCATION_TAG, "response-string", std::ios_base::in | std::ios_base::binary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"MEMORY LEAK" -- you shout
it is deleted when mockResponse
is deleted in turn calling the destructor on its bodyStream, which in turn calls delete on the underlying stream.
146937e
to
bbfdd27
Compare
bbfdd27
to
2c51217
Compare
Description of changes:
Adds tests for a possible URI traversal issue that the PHP SDK saw an issue with. Besides adding tests this adds a new target
aws-cpp-sdk-s3-unit-tests
that will run tests with a S3 client with a mocked http client.Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.