Skip to content

test(s3): cover select empty-code metadata fallbacks#158

Merged
overtrue merged 2 commits intomainfrom
codex/test-s3-select-empty-code-metadata-fallback
Apr 29, 2026
Merged

test(s3): cover select empty-code metadata fallbacks#158
overtrue merged 2 commits intomainfrom
codex/test-s3-select-empty-code-metadata-fallback

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

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 None metadata path and one Some("") case for AccessDenied, but two symmetric empty-code branches were still untested. If the SDK surfaces Some("") and the backend text contains NoSuchBucket or NotImplemented, 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_substring
  • classify_empty_code_maps_not_implemented_substring

The runtime logic is unchanged.

Validation

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

@overtrue overtrue marked this pull request as ready for review April 28, 2026 17:10
…empty-code-metadata-fallback

# Conflicts:
#	crates/s3/src/select.rs
@overtrue overtrue merged commit 810e9c7 into main Apr 29, 2026
15 checks passed
@overtrue overtrue deleted the codex/test-s3-select-empty-code-metadata-fallback branch April 29, 2026 11:32
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