-
Notifications
You must be signed in to change notification settings - Fork 251
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
e2e/util_test: enable tests to work using external endpoint #506
e2e/util_test: enable tests to work using external endpoint #506
Conversation
use testing.cleanup instead of passing cleanup functions.
Tests are now can be run using an external URL instead of local s3-server. With this, it is technically possible to observe if test files will pass in any other s3-storage such as gcs, wasabi, amazon etc.
add random suffix to all bucket names.
to be continued...
in v0.7.0, SlowDown was a retryable error. https://github.com/peak/s5cmd/blob/v0.7.0/core/error.go#L49 Add that again as retryable because with peak#506, one might get slowdown errors while testing with other endpoint urls.
in [v0.7.0](https://github.com/peak/s5cmd/blob/v0.7.0/core/error.go#L49), SlowDown was a retryable error. Add that again as retryable because with #506, one might get slowdown errors while testing with other endpoint urls.
Realized TestCopySingleFileToS3 was a faulty test. gofakess3 never reads/assigns content-type. By fixing that with following pr on @igungor's fork, it works as expected. p.s.: this commit will fail TestCopySingleFileToS3 as it depends on this change: igungor/gofakes3#7
@boraberke igungor/gofakes3#7 is merged. |
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.
This change will be very useful for us to be confident about the tool for certain s3 compatible services. Thank you.
there was no way of understanding if a specific endpoint uses virtual host style or path style when testing. Add another environment variable to get that information.
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.
🚀 Thank you!
There's a merge conflict though.
Just resolved the merge conflict 🏁 |
For the records, I did try to run tests with Backblaze B2 and there are a couple things to consider -and there might be more-;
Do not think these are blockers for this PR. We might update the tests as we start add more compatible services. |
Thanks for testing Backblaze and pointing these out! As you said, after this PR, additional compatible services can be added and tests can be updated accordingly 👍 |
With this PR, e2e tests can now be tested using external endpoint.
To do so, following environment variables need to be set:
s5cmd
will useS5CMD_ENDPOINT_URL
with credentialsS5CMD_ACCESS_KEY_ID
,S5CMD_SECRET_ACCESS_KEY
andS5CMD_REGION
to run all e2e tests instead of localgofakess3
server. Additionally, if the endpoint tested uses virtual host styleS5CMD_IS_VIRTUAL_HOST
needs to be a truthy value and control env variableS5CMD_I_KNOW_WHAT_IM_DOING
needs to be set to 1. If any of those environment variables is empty, tests will fallback to usegofakess3
instead.Additionally, tests are refactored to have the following characteristics: