Skip to content

Fix RuboCop Metrics/AbcSize offense in test_bind_int32#1039

Merged
suketa merged 1 commit intomainfrom
fix-rubocop-test-bind-int32
Feb 1, 2026
Merged

Fix RuboCop Metrics/AbcSize offense in test_bind_int32#1039
suketa merged 1 commit intomainfrom
fix-rubocop-test-bind-int32

Conversation

@suketa
Copy link
Owner

@suketa suketa commented Feb 1, 2026

Fixes the RuboCop offense:

test/duckdb_test/prepared_statement_test.rb:299:5: C: Metrics/AbcSize: Assignment Branch Condition size for test_bind_int32 is too high. [<3, 20, 0> 20.22/17]

Changes

Split test_bind_int32 into three focused tests, each testing binding to a different integer column type:

  • test_bind_int32_with_smallint: Tests INT32 binding to SMALLINT column
  • test_bind_int32: Tests INT32 binding to INTEGER column (main use case)
  • test_bind_int32_with_bigint: Tests INT32 binding to BIGINT column

This approach reduces the ABC complexity from 20.22 to within the limit of 17, making each test simpler and more focused.

Testing

  • bundle exec rubocop test/duckdb_test/prepared_statement_test.rb - Offense resolved (9 → 8 offenses)
  • bundle exec rake test - All tests pass (478 runs, 1117 assertions, 0 failures)

Summary by CodeRabbit

  • Tests
    • Expanded test coverage for integer type binding across SMALLINT, INTEGER, and BIGINT columns to ensure improved compatibility and type handling.

✏️ Tip: You can customize this high-level summary in your review settings.

Split test_bind_int32 into three focused tests to reduce ABC complexity:
- test_bind_int32_with_smallint: Tests INT32 binding to SMALLINT column
- test_bind_int32: Tests INT32 binding to INTEGER column (main use case)
- test_bind_int32_with_bigint: Tests INT32 binding to BIGINT column

This reduces ABC complexity from 20.22 to within the limit of 17.
@coderabbitai
Copy link

coderabbitai bot commented Feb 1, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The pull request expands test coverage for binding 32-bit integer values to different DuckDB column types by adding three new test cases that validate int32 binding behavior against SMALLINT, INTEGER, and BIGINT columns.

Changes

Cohort / File(s) Summary
Test Coverage Expansion
test/duckdb_test/prepared_statement_test.rb
Adds three new test methods (test_bind_int32_with_smallint, test_bind_int32, test_bind_int32_with_bigint) to validate int32 binding against SMALLINT, INTEGER, and BIGINT columns, testing type compatibility and result correctness.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 Three new tests hop into view,
Int32 bound to types so true—
SMALLINT, INTEGER, BIGINT too,
Coverage grows with each test we brew! 🧪✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-rubocop-test-bind-int32

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@suketa suketa merged commit f1d8c50 into main Feb 1, 2026
37 of 38 checks passed
@suketa suketa deleted the fix-rubocop-test-bind-int32 branch February 1, 2026 07:25
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