From 2c8cd78fcf2f63b376cf4f36e8f87e8fff46cbd5 Mon Sep 17 00:00:00 2001 From: Roberto Miranda Date: Tue, 21 Nov 2023 16:05:45 +0000 Subject: [PATCH 1/3] Update shutdown method --- lib/streamy/message_buses/kafka_message_bus.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/streamy/message_buses/kafka_message_bus.rb b/lib/streamy/message_buses/kafka_message_bus.rb index 761ccf8..2936b6b 100644 --- a/lib/streamy/message_buses/kafka_message_bus.rb +++ b/lib/streamy/message_buses/kafka_message_bus.rb @@ -24,8 +24,8 @@ def deliver(key:, topic:, payload:, priority:) end def shutdown - async_producer.shutdown if async_producer? - sync_producers.map(&:shutdown) + async_producer.close if async_producer? + sync_producers.map(&:close) end private @@ -48,7 +48,7 @@ def async_producer end def async_producer? - @_async_producer.present? + !!@_async_producer end def sync_producer From 9052c21b8cd3fe7176e78a8926ad2b03603c7903 Mon Sep 17 00:00:00 2001 From: Roberto Miranda Date: Tue, 21 Nov 2023 16:15:57 +0000 Subject: [PATCH 2/3] Fix Test suite and update test cases --- streamy.gemspec | 2 +- test/message_buses/kafka_message_bus_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/streamy.gemspec b/streamy.gemspec index 09941d1..020fd81 100644 --- a/streamy.gemspec +++ b/streamy.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.add_development_dependency "capybara" spec.add_development_dependency "minitest", "~> 5.0" spec.add_development_dependency "minitest-focus" - spec.add_development_dependency "mocha", "~> 1.4" + spec.add_development_dependency "mocha", "~> 2.0" spec.add_development_dependency "pry", "~> 0.11" spec.add_development_dependency "rake", ">= 12.3.3" spec.add_development_dependency "rspec" diff --git a/test/message_buses/kafka_message_bus_test.rb b/test/message_buses/kafka_message_bus_test.rb index b2ee9d8..4d8b8c5 100644 --- a/test/message_buses/kafka_message_bus_test.rb +++ b/test/message_buses/kafka_message_bus_test.rb @@ -146,7 +146,7 @@ def test_config_overrides def test_sync_producer_shutdown example_delivery(:essential) - producer.expects(:shutdown) + producer.expects(:close) bus.shutdown end @@ -154,7 +154,7 @@ def test_sync_producer_shutdown def test_async_producer_shutdown example_delivery(:standard) - producer.expects(:shutdown) + producer.expects(:close) bus.shutdown end From 9f1b170989be6bfeaff6ed48d352391255141841 Mon Sep 17 00:00:00 2001 From: Roberto Miranda Date: Tue, 21 Nov 2023 16:17:37 +0000 Subject: [PATCH 3/3] Update Ruby Matrix --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55a2ce7..21e4070 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,11 @@ jobs: matrix: ruby: - 'head' + - '3.2' - '3.1' - '3.0' - - '2.7' continue-on-error: ${{ matrix.ruby == 'head' }} name: Ruby ${{ matrix.ruby }} - steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1