Conversation
There was a problem hiding this comment.
Pull request overview
Migrates the Ruby test suite from RSpec to Minitest and updates project tooling (CI, linting, coverage) to match the new test runner.
Changes:
- Replaces RSpec specs with Minitest test files under
test/and updates helpers accordingly. - Updates CI workflows to run
rake testand switches RuboCop/Standard plugins from RSpec to Minitest. - Adjusts packaging/lint/coverage configuration to exclude the new test suite paths.
Reviewed changes
Copilot reviewed 79 out of 85 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/lib/rdkafka/producer/partitions_count_cache_test.rb | Adds Minitest coverage for PartitionsCountCache behaviors formerly in RSpec. |
| test/lib/rdkafka/producer/delivery_report_test.rb | Ports DeliveryReport specs to Minitest assertions. |
| test/lib/rdkafka/producer/delivery_handle_test.rb | Ports DeliveryHandle wait/result behaviors from RSpec to Minitest. |
| test/lib/rdkafka/native_kafka_test.rb | Replaces RSpec doubles/stubs with Minitest::Mock and stub. |
| test/lib/rdkafka/metadata_test.rb | Migrates metadata-related specs to Minitest. |
| test/lib/rdkafka/error_test.rb | Migrates error object specs to Minitest. |
| test/lib/rdkafka/defaults_test.rb | Migrates defaults constant specs to Minitest. |
| test/lib/rdkafka/consumer/topic_partition_list_test.rb | Migrates TopicPartitionList specs to Minitest. |
| test/lib/rdkafka/consumer/partition_test.rb | Migrates Partition specs to Minitest. |
| test/lib/rdkafka/consumer/message_test.rb | Migrates Message specs to Minitest; keeps FFI stubbing. |
| test/lib/rdkafka/consumer/headers_test.rb | Re-implements headers parsing specs using pure Minitest + FFI pointers. |
| test/lib/rdkafka/config_test.rb | Migrates config-related specs to Minitest. |
| test/lib/rdkafka/bindings_test.rb | Migrates bindings/callback specs to Minitest. |
| test/lib/rdkafka/admin/list_offsets_report_test.rb | Adds Minitest coverage for list offsets report null handling. |
| test/lib/rdkafka/admin/list_offsets_handle_test.rb | Adds Minitest coverage for list offsets handle behaviors. |
| test/lib/rdkafka/admin/describe_acl_report_test.rb | Adds Minitest coverage for describe ACL report parsing. |
| test/lib/rdkafka/admin/describe_acl_handle_test.rb | Adds Minitest coverage for describe ACL handle behaviors. |
| test/lib/rdkafka/admin/delete_topic_report_test.rb | Adds Minitest coverage for delete topic report fields. |
| test/lib/rdkafka/admin/delete_topic_handle_test.rb | Adds Minitest coverage for delete topic handle behaviors. |
| test/lib/rdkafka/admin/delete_acl_report_test.rb | Adds Minitest coverage for delete ACL report parsing. |
| test/lib/rdkafka/admin/delete_acl_handle_test.rb | Adds Minitest coverage for delete ACL handle behaviors. |
| test/lib/rdkafka/admin/create_topic_report_test.rb | Adds Minitest coverage for create topic report fields. |
| test/lib/rdkafka/admin/create_topic_handle_test.rb | Adds Minitest coverage for create topic handle behaviors. |
| test/lib/rdkafka/admin/create_acl_report_test.rb | Adds Minitest coverage for create ACL report fields. |
| test/lib/rdkafka/admin/create_acl_handle_test.rb | Adds Minitest coverage for create ACL handle behaviors. |
| test/lib/rdkafka/abstract_handle_test.rb | Migrates abstract handle registry/wait behavior specs to Minitest. |
| spec/spec_helper.rb | Reworks the helper to Minitest initialization, suite setup, and per-test timeouts. |
| spec/lib/rdkafka/producer/partitions_count_cache_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/producer/delivery_report_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/producer/delivery_handle_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/native_kafka_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/metadata_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/error_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/defaults_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/consumer/topic_partition_list_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/consumer/partition_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/consumer/message_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/consumer/headers_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/config_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/callbacks_spec.rb | Updates a leftover spec file to require test_helper (transition artifact). |
| spec/lib/rdkafka/bindings_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin_spec.rb | Removes the large RSpec admin suite (not yet replaced here). |
| spec/lib/rdkafka/admin/list_offsets_report_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/list_offsets_handle_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/describe_acl_report_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/describe_acl_handle_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/delete_topic_report_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/delete_topic_handle_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/delete_acl_report_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/delete_acl_handle_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/create_topic_report_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/create_topic_handle_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/create_acl_report_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/admin/create_acl_handle_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| spec/lib/rdkafka/abstract_handle_spec.rb | Removes RSpec test file in favor of Minitest replacement. |
| rdkafka.gemspec | Updates gem packaging filters to exclude test/ instead of spec/. |
| Rakefile | Adds a Minitest rake task and makes it the default. |
| Gemfile.lint.lock | Switches lint tooling dependencies from RSpec cops to Minitest cops. |
| Gemfile.lint | Replaces rubocop-rspec / standard-rspec with Minitest equivalents. |
| Gemfile | Adds Minitest dependencies and removes RSpec. |
| CHANGELOG.md | Documents the test framework migration under an unreleased version. |
| .yard-lint.yml | Updates yard-lint exclusions from spec/ to test/. |
| .rubocop.yml | Updates RuboCop plugins/standard config from RSpec to Minitest. |
| .rspec | Removes RSpec runner configuration file. |
| .github/workflows/ci_macos_arm64.yml | Runs rake test instead of rspec. |
| .github/workflows/ci_linux_ubuntu_x86_64_gnu_complementary.yml | Runs rake test and points integration paths at test/integrations. |
| .github/workflows/ci_linux_ubuntu_x86_64_gnu.yml | Runs rake test instead of rspec (including SSL job). |
| .github/workflows/ci_linux_ubuntu_aarch64_gnu_complementary.yml | Runs rake test and points integration paths at test/integrations. |
| .github/workflows/ci_linux_ubuntu_aarch64_gnu.yml | Runs rake test instead of rspec. |
| .github/workflows/ci_linux_debian_x86_64_gnu_complementary.yml | Runs rake test and points integration paths at test/integrations. |
| .github/workflows/ci_linux_debian_x86_64_gnu.yml | Runs rake test instead of rspec. |
| .github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml | Runs rake test and points integration paths at test/integrations. |
| .github/workflows/ci_linux_alpine_x86_64_musl.yml | Runs rake test instead of rspec. |
| .github/workflows/ci_linux_alpine_aarch64_musl_complementary.yml | Runs rake test and points integration paths at test/integrations. |
| .github/workflows/ci_linux_alpine_aarch64_musl.yml | Runs rake test instead of rspec. |
Comments suppressed due to low confidence (3)
test/lib/rdkafka/consumer/headers_test.rb:1
FFI::MemoryPointer#write_pointerexpects anFFI::Pointer, but this stub writes an Integer (headers_ptr.object_id). This will raiseTypeError(or produce invalid pointers) when the production code later reads the pointer. Use a realFFI::Pointervalue forheaders_ptr(for example, allocate a smallFFI::MemoryPointerand write that pointer), and write that pointer intoptr.
test/lib/rdkafka/native_kafka_test.rb:1Minitest::Mockexpectations are only enforced whenverifyis called, but@thread.verifyis never invoked. As a result, tests can pass even ifname=,[]=orabort_on_exception=are not called. Consider verifying the mock inteardown(ideally in anensureso it runs even if the test fails) and also verifying any mock threads created inside individual tests (for example intest_polling_thread_is_created).
test/lib/rdkafka/native_kafka_test.rb:1Minitest::Mockexpectations are only enforced whenverifyis called, but@thread.verifyis never invoked. As a result, tests can pass even ifname=,[]=orabort_on_exception=are not called. Consider verifying the mock inteardown(ideally in anensureso it runs even if the test fails) and also verifying any mock threads created inside individual tests (for example intest_polling_thread_is_created).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| files = files.reject do |file| | ||
| next true if file.start_with?(".") | ||
| next true if file.start_with?("spec/") | ||
| next true if file.start_with?("test/") |
There was a problem hiding this comment.
This changes the packaged-files exclusion from spec/ to test/, but spec/ still exists in this PR (for example spec/spec_helper.rb). That means the gem may now inadvertently ship spec/ artifacts. If the intent is to exclude all test infrastructure from the gem, also exclude spec/ (or remove/move the remaining spec/ files).
| next true if file.start_with?("test/") | |
| next true if file.start_with?("test/") | |
| next true if file.start_with?("spec/") |
| - vendor/**/* | ||
| - node_modules/**/* | ||
| - spec/**/* | ||
| - test/**/* |
There was a problem hiding this comment.
This switches YARD lint exclusions from spec/** to test/**, but the PR still retains files under spec/ (notably spec/spec_helper.rb). If yard-lint runs over spec/ now, it may unexpectedly fail coverage/validation. Either remove/move remaining spec/ files, or keep excluding spec/** as well.
| - test/**/* | |
| - test/**/* | |
| - spec/**/* |
No description provided.