Skip to content

test(sql): cover select error exit codes#149

Merged
overtrue merged 1 commit intomainfrom
codex/test-sql-select-path-gaps-20260422130157
Apr 22, 2026
Merged

test(sql): cover select error exit codes#149
overtrue merged 1 commit intomainfrom
codex/test-sql-select-path-gaps-20260422130157

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Related issue(s)

Automated test-gap detection for the recent S3 Select command work.

Background

The S3 Select command recently added command-level handling for backend errors returned by the select adapter. Existing and open coverage now exercises parser wiring and S3 serialization shapes, but the SQL command's final mapping from rc-core errors to CLI exit codes was not directly covered.

Root cause

sql::execute delegates backend failures through exit_code_from_error, so regressions in unsupported-feature, missing-object, auth, network, or generic error mappings could change automation-visible process outcomes without a focused command-layer test.

Solution

Add a small unit test in crates/cli/src/commands/sql.rs that covers representative backend errors and their expected SQL command exit codes. This keeps the scope limited to the recent S3 Select command path and avoids duplicating the open parser and S3 serialization PRs.

Test status

  • cargo test -p rustfs-cli commands::sql::tests::sql_exit_code_from_backend_errors --lib
  • cargo fmt --all --check
  • make pre-commit

@overtrue overtrue marked this pull request as ready for review April 22, 2026 05:11
@overtrue overtrue merged commit fc9c230 into main Apr 22, 2026
15 checks passed
@overtrue overtrue deleted the codex/test-sql-select-path-gaps-20260422130157 branch April 22, 2026 14:10
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