e2e/util_test: enable tests to work using external endpoint#506
e2e/util_test: enable tests to work using external endpoint#506igungor merged 30 commits intopeak:masterfrom
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. |
igungor
left a comment
There was a problem hiding this comment.
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.
seruman
left a comment
There was a problem hiding this comment.
🚀 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:
s5cmdwill useS5CMD_ENDPOINT_URLwith credentialsS5CMD_ACCESS_KEY_ID,S5CMD_SECRET_ACCESS_KEYandS5CMD_REGIONto run all e2e tests instead of localgofakess3server. Additionally, if the endpoint tested uses virtual host styleS5CMD_IS_VIRTUAL_HOSTneeds to be a truthy value and control env variableS5CMD_I_KNOW_WHAT_IM_DOINGneeds to be set to 1. If any of those environment variables is empty, tests will fallback to usegofakess3instead.Additionally, tests are refactored to have the following characteristics: