Skip to content

test(s3): cover empty-code no-such-key fallback#161

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

test(s3): cover empty-code no-such-key fallback#161
overtrue merged 1 commit intomainfrom
codex/test-s3-select-empty-code-nosuchkey

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

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 None metadata for NoSuchKey and the empty-string fallback for AccessDenied, while open PR #158 covers the remaining empty-string NoSuchBucket and NotImplemented branches. One symmetric branch was still untested: if the SDK surfaces Some("") and the backend text contains NoSuchKey, 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-code NoSuchKey path.

Changes

  • Add classify_empty_code_maps_no_such_key_substring in crates/s3/src/select.rs
  • Keep runtime logic unchanged

Validation

  • cargo test -p rc-s3 select::tests --lib
  • make pre-commit

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