test(s3): cover empty-code no-such-key fallback#161
Merged
Conversation
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 one focused regression test for the S3 Select error-classification path that treats an empty AWS error code the same as missing metadata.
The current test coverage already exercises
Nonemetadata forNoSuchKeyand the empty-string fallback forAccessDenied, while open PR #158 covers the remaining empty-stringNoSuchBucketandNotImplementedbranches. One symmetric branch was still untested: if the SDK surfacesSome("")and the backend text containsNoSuchKey, the CLI should continue to classify the response as object-not-found instead of falling back to a generic error.Root cause
The implementation already normalizes empty error codes with
code.filter(|s| !s.is_empty()), so the runtime behavior was correct. The gap was only in regression coverage for that final empty-codeNoSuchKeypath.Changes
classify_empty_code_maps_no_such_key_substringincrates/s3/src/select.rsValidation
cargo test -p rc-s3 select::tests --libmake pre-commit