Tests can be run using cargo
cargo test
By default, integration tests are not run. To run them you will need to set TEST_INTEGRATION=1
and then provide the
necessary configuration for that object store
To test the S3 integration against localstack
First start up a container running localstack
$ podman run --rm -it -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack
Setup environment
export TEST_INTEGRATION=1
export AWS_DEFAULT_REGION=us-east-1
export AWS_ACCESS_KEY_ID=test
export AWS_SECRET_ACCESS_KEY=test
export AWS_ENDPOINT=http://128.0.0.1:4566
export OBJECT_STORE_BUCKET=test-bucket
Create a bucket using the AWS CLI
podman run --net=host --env-host amazon/aws-cli --endpoint-url=http://localhost:4566 s3 mb s3://test-bucket
Run tests
$ cargo test --features aws
To test the Azure integration against azurite
Startup azurite
$ podman run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite
Create a bucket
$ podman run --net=host mcr.microsoft.com/azure-cli az storage container create -n test-bucket --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://128.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://128.0.0.1:10001/devstoreaccount1;'
Run tests
$ cargo test --features azure
To test the GCS integration, we use Fake GCS Server
Startup the fake server:
docker run -p 4443:4443 fsouza/fake-gcs-server
Configure the account:
curl --insecure -v -X POST --data-binary '{"name":"test-bucket"}' -H "Content-Type: application/json" "https://localhost:4443/storage/v1/b"
echo '{"gcs_base_url": "https://localhost:4443", "disable_oauth": true, "client_email": "", "private_key": ""}' > /tmp/gcs.json
Now run the tests:
TEST_INTEGRATION=1 \
OBJECT_STORE_BUCKET=test-bucket \
GOOGLE_SERVICE_ACCOUNT=/tmp/gcs.json \
cargo test -p object_store --features=gcp