Development instructions

Running Tests

First check out test files with

git submodule update --init

Then run all the tests with

cargo test --all-targets

Running Storage Integration Tests

By default, storage integration tests are not run. These tests use the testcontainers crate to start up a local RustFS server using Docker with a dynamically assigned host port.

To run them you will need to set TEST_STORAGE_INTEGRATION:

TEST_STORAGE_INTEGRATION=1 cargo test

For some of the tests, snapshots are used.

AWS

S3 integration is tested against RustFS with TestContainers This requires Docker to be running on your machine.

If you see an error mentioning “failed to load IMDS session token” such as

---- object_storage::tests::s3_object_store_builder_resolves_region_when_none_provided stdout ---- Error: ObjectStore(Generic { store: “S3”, source: “Error getting credentials from provider: an error occurred while loading credentials: failed to load IMDS session token” })

You may need to disable trying to fetch S3 credentials from the environment using the AWS_EC2_METADATA_DISABLED, for example:

$ AWS_EC2_METADATA_DISABLED=true TEST_STORAGE_INTEGRATION=1 cargo test