Closed marciocadev closed 1 month ago
Hey @marciocadev - what's the status of this PR? Once it's ready for review please let me know and move it out of draft, thank you
Hey @staycoolcall911
I'm having an issue with the getSignedUrl
test, the aws-sdk is a bit tricky to mock and spyOn
@staycoolcall911, I need some help here.
Everything is okay, but the signedUrl test isn't working because I can't mock the getSignedUrl method. I created a project to test by copying this method, and the test I'm using in my project works perfectly.
I'm not able to get this to work, could someone help me with this?
Here's the project with the test working
Hey @marciocadev - of course, I'll find someone to help you out.
@marciocadev - @hasanaburayyan will reach out soon.
@marciocadev my bad, I for some reason thought https://github.com/winglang/wing/pull/5429 included this change. But I see it only upgraded the sdk to 3.490.0
I tried a few approaches (like mocks and spies) within our repo and also got stuck. After seeing it worked in https://github.com/marciocadev/AWSSignedUrlTest, I decided to instead try removing code from our repo to see what was necessary to get it working.
I'm not quite sure why it fixes it, but if I comment out this line in our vitest config, it seems to fix the test. cc @MarkMcCulloh https://github.com/winglang/wing/blob/845360a7877629185cac62ac9464b21a91c12608/libs/wingsdk/vitest.config.mts#L5
@marciocadev @hasanaburayyan I feel for now it's better if we upgrade to the latest AWS SDK version and try to address the test mocking issue another time. I've pushed a commit that skips the relevant tests - let's try and get this across the finish line
Spec tests passed: https://github.com/winglang/wing/actions/runs/9133888270
Thanks for contributing, @marciocadev! This PR will now be added to the merge queue, or immediately merged if update-aws-sdk
is up-to-date with main
and the queue is empty.
Congrats! :rocket: This was released in Wing 0.73.53.
This PR updates the aws-sdk past version 3.502, which reduces the cold start runtime on Lambdas according to the article by David Behroozi: Coldstarts with the AWS Javascript 3.502 SDK
I did some tests and in a simple code like the one below, I managed to reduce the cold start from an average of 340ms to an average of 280ms (it's not much but every millisecond counts).
Checklist
pr/e2e-full
label if this feature requires end-to-end testingBy submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.