Skip to content

test(s3): cover delete object error mapping#126

Merged
overtrue merged 1 commit intomainfrom
codex/delete-error-mapping-test-gap
Apr 19, 2026
Merged

test(s3): cover delete object error mapping#126
overtrue merged 1 commit intomainfrom
codex/delete-error-mapping-test-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This change closes a test gap in the recent RustFS force-delete work by covering the delete-object error path in crates/s3/src/client.rs.

The recent delete-with-options implementation already had tests for the custom x-rustfs-force-delete header, but it did not verify how SDK service errors were classified. That left a real behavior gap: when the backend returned a missing-key service error, the code collapsed it to a generic "service error" string and surfaced it as a network error instead of Error::NotFound.

This patch adds focused unit tests for the two relevant branches and updates the delete-object path to inspect service error metadata before mapping the result. Missing-key responses now map to Error::NotFound, while other service failures remain network errors with a more informative message.

Validation

I first added the missing tests and confirmed they failed against the original implementation. After the minimal fix, the focused rc-s3 tests passed.

The repository does not contain a Makefile or a make pre-commit target, so I ran the documented project checks directly instead:

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

@overtrue overtrue force-pushed the codex/delete-error-mapping-test-gap branch from 22802dd to e196058 Compare April 19, 2026 15:25
@overtrue overtrue marked this pull request as ready for review April 19, 2026 15:25
@overtrue overtrue merged commit 1cb5c60 into main Apr 19, 2026
15 checks passed
@overtrue overtrue deleted the codex/delete-error-mapping-test-gap branch April 19, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant