Skip to content

test(s3): cover missing bucket cors configuration#105

Draft
overtrue wants to merge 1 commit intomainfrom
codex/cors-missing-config-gap
Draft

test(s3): cover missing bucket cors configuration#105
overtrue wants to merge 1 commit intomainfrom
codex/cors-missing-config-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

Add focused rc-s3 coverage for bucket CORS operations when the backend reports that no CORS configuration exists. This keeps the scope on a recent CORS code path without changing runtime behavior.

Problem

Recent bucket CORS support added logic to treat missing bucket CORS state as an empty configuration on reads and as a successful no-op on deletes. That behavior was implemented, but there was no direct unit coverage proving the S3 client maps the NoSuchCORSConfiguration 404 path correctly.

Root Cause

The existing tests only covered the helper predicates that classify missing CORS responses. They did not exercise the public get_bucket_cors and delete_bucket_cors methods with an actual mocked SDK response, so a regression in the method-level handling could slip through.

Fix

Add two rc-s3 unit tests that feed mocked 404 NoSuchCORSConfiguration responses into the client. One verifies get_bucket_cors returns an empty rule list, and the other verifies delete_bucket_cors succeeds.

Validation

  • cargo test -p rc-s3 get_bucket_cors_missing_configuration_returns_empty_rules
  • cargo test -p rc-s3 delete_bucket_cors_missing_configuration_is_successful
  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

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