test(s3): cover select empty-code metadata fallbacks#158
Merged
Conversation
…empty-code-metadata-fallback # Conflicts: # crates/s3/src/select.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds focused regression coverage for the S3 Select error-classification path that treats an empty AWS error code the same as missing metadata.
Recent follow-up PRs covered the
Nonemetadata path and oneSome("")case forAccessDenied, but two symmetric empty-code branches were still untested. If the SDK surfacesSome("")and the backend text containsNoSuchBucketorNotImplemented, the CLI should continue to classify those responses as not found and unsupported feature rather than falling back to a generic error.Root cause
The implementation already normalizes empty error codes with
code.filter(|s| !s.is_empty()), so behavior was correct. The remaining gap was test coverage: those two empty-code fallback branches were not asserted explicitly, which left room for future regressions in the shared classifier.Changes
This PR adds two unit tests in
crates/s3/src/select.rs:classify_empty_code_maps_no_such_bucket_substringclassify_empty_code_maps_not_implemented_substringThe runtime logic is unchanged.
Validation
cargo test -p rc-s3 select::tests --libmake pre-commit