What would a test framework for zs3 look like?
Hey @xach, we chatted briefly a few times last year about submitting some code to zs3 to support things like multipart uploads, and DigitalOcean support.
It would be nice to have a set of tests to rely on so I can ensure things aren't breaking. Have you put any thought into this space?
I took a look at the official AWS Go client to see how they are doing testing, and it looks like they've taken the mocking approach.
- First they piggy-back off of a default config and then populate[1] it with mocked values.
- The library appears to use a list of Handlers to handle requests at very stages. They clear, the default list and replace it with mocked functions[2].
Since this is the official Go client for all of AWS, they have a lot of resources working on this. I'm trying to consider whether this style of testing would lend itself to zs3, assuming you are open to it.
[1] - https://github.com/aws/aws-sdk-go-v2/blob/9503cfa08dd8766632c983f916d053fef919277d/internal/awstesting/unit/unit.go#L10-L18 [2] - https://github.com/aws/aws-sdk-go-v2/blob/master/service/s3/bucket_location_test.go#L28-L32
My first instinct is to use simulated network activity in the form of files. The response object is either populated directly from a file, or the drakma result is simulated from a file, and the response is parsed out from there.
On Fri, Jan 24, 2020 at 11:36 AM Katherine Cox-Buday < [email protected]> wrote:
I took a look at the official AWS Go client to see how they are doing testing, and it looks like they've taken the mocking approach.
- First they piggy-back off of a default config and then populate[1] it with mocked values.
- The library appears to use a list of Handlers https://github.com/aws/aws-sdk-go-v2/blob/9503cfa08dd8766632c983f916d053fef919277d/aws/handlers.go#L8-L9 to handle requests at very stages. They clear, the default list and replace it with mocked functions[2].
Since this is the official Go client for all of AWS, they have a lot of resources working on this. I'm trying to consider whether this style of testing would lend itself to zs3, assuming you are open to it.
[1] - https://github.com/aws/aws-sdk-go-v2/blob/9503cfa08dd8766632c983f916d053fef919277d/internal/awstesting/unit/unit.go#L10-L18 [2] - https://github.com/aws/aws-sdk-go-v2/blob/master/service/s3/bucket_location_test.go#L28-L32
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xach/zs3/issues/38?email_source=notifications&email_token=AAAEB7YFRJGVZFPDHWTO7V3Q7MKILA5CNFSM4KK6S2CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ3LKOQ#issuecomment-578204986, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEB7Y6DUUIZSPRGFIAVA3Q7MKILANCNFSM4KK6S2CA .