Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

s3manageriface.UploadWithIterator conflicting use cases #5034

Closed
thenom opened this issue Oct 24, 2023 · 0 comments
Closed

s3manageriface.UploadWithIterator conflicting use cases #5034

thenom opened this issue Oct 24, 2023 · 0 comments
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.

Comments

@thenom
Copy link

thenom commented Oct 24, 2023

Describe the issue

Original issue: #1810

I cant see how the linked unit test in this post references s3manageriface.UploadWithIterator (i get that things might have moved on but it seems to have removed it all together), it just seems to setup a http server as the session url and then just uses the normal Uploader type as a client but with an overiden server.url. I usually mock the API iface service (for example SSMAPI) and normally do the same when mocking the S3 upload for example to make sure that the unit test catches the call but in this case i cant due to the UploadWithIterator missing from the UploaderAPI.

As the UploadWithIterator is a function on Uploader type (https://pkg.go.dev/github.com/aws/aws-sdk-go/service/s3/s3manager#Uploader.UploadWithIterator), how am i supposed to mock that function with an interface (https://pkg.go.dev/github.com/aws/[email protected]/service/s3/s3manager/s3manageriface#UploadWithIterator) and intercept the calls? This might be my basic knowledge of Go but this doesnt seem to function like all the other AWSSDK iface services i have used.

If i was to do this without unit tests (:/) i would just use the Uploader type then use its UploadWithIterator. My normal route to writing unit tests would then be to convert the Uploader to UploaderAPI so i could mock the upload\batch function (guessing here as not been able to do it) and then just continue to unit test UploadWithIterator on that but i cant.

TL;DR;

Is there a minimal unit test i can reference for it with corresponding main code?

Links

https://pkg.go.dev/github.com/aws/aws-sdk-go/service/s3/s3manager#Uploader.UploadWithIterator

@thenom thenom added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Oct 24, 2023
@aws aws locked and limited conversation to collaborators Dec 13, 2023
@lucix-aws lucix-aws converted this issue into discussion #5108 Dec 13, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant