afero
afero copied to clipboard
Added Support for openstack swift object storage
This pr adds support for openstack swift object storage.
To run the tests, you'll need access to an openstack swift store, I've used the one from ovh since its pretty cheap (at least for testing). You'll then need to set the env variables SWIFT_APIUSER
, SWIFT_APIKEY
, SWIFT_AUTHURL
and SWIFT_DOMAIN
. Also someone needs to do this in travis if we want to run these tests in the ci.
Needs a rebase
@kargakis Done!
I force-pushed the changes again since I kind messed up the rebase and accidentally included a lot of unrelated changes in the branch. Now it's all nice and clean.
Can you document how to configure a Swift backend in https://github.com/spf13/afero#available-backends? Also the unit tests seem to fail in CI, please have a look.
The test fails in ci because it needs a swift store to run the test and no access keys were provided. Someone with access to the ci needs to set the env variables SWIFT_APIUSER
, SWIFT_APIKEY
, SWIFT_AUTHURL
and SWIFT_DOMAIN
.
I'll add docs about how to use the backend.
@spf13 please have a look and let us know how do you want to proceed with unit testing the Swift backend.
@kargakis Added the documentation.
IMHO, "classic" unit testing this does not really make sense since most of the package is glue code between afero and the swift package. I think this kind of integration test with talking to a "real" storage server makes the most sense. Maybe we could put one (through docker?) in the ci though to reduce dependency on external services. Not sure how much of a hassle that would be.
IMHO, "classic" unit testing this does not really make sense since most of the package is glue code between afero and the swift package. I think this kind of integration test with talking to a "real" storage server makes the most sense. Maybe we could put one (through docker?) in the ci though to reduce dependency on external services. Not sure how much of a hassle that would be.
This is nitpicking but you are right, my bad on using the word "unit". In any case, my question to @spf13 still stands, I am not sure how easy or whether it is possible at all to run our own services in Travis and/or AppVeyor.
As with the GCS implementation, we can go ahead and merge this without "real" storage tests, just need to note in README that there is experimental support.
https://github.com/spf13/afero/pull/331
@kolaente can you rebase on top of latest master?
@kargakis wow I completely forgot I had this PR open :upside_down_face:
Just rebased, what should we do with the tests? Since they can't really run in CI as of now.
Does the Swift library you are using have a mock client?
The swift library has a fake swift server which stores everything in memory. As far as I understand it, that's kind of a mock client but more on the integration side. Not sure if we can use this here.