-
Notifications
You must be signed in to change notification settings - Fork 431
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 test for s3 back-end (read, write, listdir) using moto lib. #121
Conversation
That's perfect. You've stumbled upon some code that was (blindly?) copied over from an internal repository to handle some netflix specific use-cases. You intuition and suggestions on the topic sound right to me. Looks like the specs need credentials, does it need anonymous creds passed to the client? |
Indeed you need the AWS credentials (from boto3). There are different ways to pass those credentials (see https://boto3.readthedocs.io/en/latest/guide/configuration.html#guide-configuration) but typically those are stored in the AWS credential file. You have a good point though that if you don't have those the tests on s3 will fail. I guess we could bypass the tests if boto3 cannot be properly initialized. |
All the aws libraries have anonymous credentials you can set for testing purposes against mock s3's. I can look up the docs for boto3 in particular tomorrow to link. |
Oh! I did not know that. Thanks! |
I think this should satisfy the ability: https://stackoverflow.com/questions/34865927/can-i-use-boto3-anonymously |
I see. I misunderstood what you wrote earlier. For some reason, I thought that "test" credentials were available. I understand, now, that you're talking about anonymous access to S3. |
…entials on the session
Codecov Report
@@ Coverage Diff @@
## master #121 +/- ##
==========================================
+ Coverage 63.31% 73.16% +9.84%
==========================================
Files 8 8
Lines 924 924
==========================================
+ Hits 585 676 +91
+ Misses 339 248 -91 |
Rainy afternoon so I decided to tackle this. |
Awesome work. Thanks for getting that fix in. Did @rgbkrk invite you to the Nteract org yet? We like inviting people who make good contributions. |
Thanks. And yes I was invited (and accepted the invitation). When I have a bit of time, I'll work on integrating s3fs package. |
(sorry for the delay - just got back from vacation).
This is to address issue #117
The test coverage is admittedly very limited, and it is for 2 reasons:
Therefore because a) I did not understand some of the complexity/ purposes of the s3.py functions and b) would like this module to be replaced, I wrote the tests for the functions iorw.py actually uses.
Hope this is fine.