scripts/s3-tests/S3_COMPAT_WORKFLOW.md
Step-by-step guide for identifying and fixing S3 API compatibility issues in RustFS.
cargo, rustc)git remote add upstream https://github.com/rustfs/rustfs.git)git checkout main
git fetch upstream
git merge upstream/main
Pick ~20 tests from unimplemented_tests.txt and write them to selected_tests.txt:
TESTEXPR=$(scripts/s3-tests/build_testexpr.sh selected_tests.txt) \
DEPLOY_MODE=build MAXFAIL=0 ./scripts/s3-tests/run.sh
Or run them directly:
TESTEXPR="test_foo or test_bar" DEPLOY_MODE=build MAXFAIL=0 ./scripts/s3-tests/run.sh
Review artifacts/s3tests-single/pytest.log for results.
From the test report, classify each failure:
| Category | Action |
|---|---|
Feature not implemented (e.g., returns 501 Not Implemented) | Skip — do not attempt |
| Incorrect HTTP status code or response body | Good candidate for a fix |
| Teardown/cleanup issue (test passes but cleanup fails) | Good candidate — usually simple |
| Complex multi-feature dependency | Defer to a later iteration |
Pick the simplest failure to fix. "Simplest" means: fewest code paths affected, clearest expected behavior, closest to existing implementation.
Before writing any code:
s3-tests/s3tests/functional/test_s3.py to understand exactly what the test expects.github.com/minio/minio) — find the equivalent handler and see how it handles the same edge case. This is critical because RustFS was ported from MinIO's Go code to Rust.git checkout main
git checkout -b fix/s3-compat-<short-description>
One branch per fix. Never combine unrelated fixes in a single branch.
If the fix involves logic changes, add unit tests before modifying the production code:
#[cfg(test)] mod tests { ... })test_<operation>_<scenario>_<expected_outcome>Guidelines:
s3s crate. Respect its traits, error types, and request/response patterns.unwrap() or expect() in production code — use proper error handling with Result and ?.Run the specific test(s) you fixed:
TESTEXPR="test_the_fixed_test" DEPLOY_MODE=build ./scripts/s3-tests/run.sh
Then run the full implemented test suite to confirm no regressions:
./scripts/s3-tests/run.sh
make pre-commit
This runs:
cargo fmt --all --checkcargo clippy --all-targets --all-features -- -D warningscargo test --workspace --exclude e2e_testAll three must pass before committing.
git add -A
git commit -m "fix(s3): <concise description of the fix>"
Write a PR description following .github/pull_request_template.md. The description must:
Move the now-passing test(s) from unimplemented_tests.txt to implemented_tests.txt. Update the test count comment in implemented_tests.txt.