Skip to content

test(s3): cover select empty error-code fallback#157

Merged
overtrue merged 1 commit intomainfrom
codex/test-s3-select-empty-code-fallback
Apr 28, 2026
Merged

test(s3): cover select empty error-code fallback#157
overtrue merged 1 commit intomainfrom
codex/test-s3-select-empty-code-fallback

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This PR adds focused regression coverage for one remaining S3 Select error-classification fallback path.

Recent test-gap work around classify_aws_code already covered missing-metadata fallbacks such as AccessDenied, NoSuchBucket, NotImplemented, and NoSuchKey. One small branch was still untested: when the SDK surfaces an empty error code string instead of omitting the metadata entirely. The runtime code intentionally treats an empty code the same as missing metadata by filtering it out before substring-based fallback classification.

This patch adds a single unit test in crates/s3/src/select.rs to lock that behavior in place. It does not change runtime logic.

Root Cause

The fallback logic uses code.filter(|s| !s.is_empty()) before dispatching to the missing-metadata classifier, but the existing tests only exercised None metadata and did not cover the Some("") case. That left a small but real compatibility path unverified.

Validation

  • cargo test -p rc-s3 classify_empty_code_maps_access_denied_substring --lib
  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace
  • make pre-commit

@overtrue overtrue marked this pull request as ready for review April 28, 2026 09:14
@overtrue overtrue merged commit 92a59b8 into main Apr 28, 2026
15 checks passed
@overtrue overtrue deleted the codex/test-s3-select-empty-code-fallback branch April 28, 2026 14:11
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