karafka-testing 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fae4b939191c552b4f9a1c7244e832de0f721ea5297c3a741b7c263b1e2d6a52
4
- data.tar.gz: e12fa021909dca8333090b6bb685f24cc418d6f5f93a3049c51677e3b1a1f46c
3
+ metadata.gz: eeeff63f4e69e293379802fe9359ad9fa431f7e9c805c090e985cb53c92b7b16
4
+ data.tar.gz: 8dae650679708a37c060c9b2e45b7996a2b8330b7bbf1668ba248643d6bb33d0
5
5
  SHA512:
6
- metadata.gz: ee5da08ea6b37dd2cf9bd19141d246288fdf1cddd4206c2159006cc09df0a63a8dc307cba3920435c5636872c5df8c3d91ca2998f673cf796cc41cf297ae5014
7
- data.tar.gz: d5555fd3870e33a1a0ae36da998d27326a4fc71a1829990f3442df048d7d28a0a53644415fb82da8f636b7904309e1ca9d03cee2ab16e2365ee1236a9d7d2c24
6
+ metadata.gz: f26ac82183a7e57e63b37e59964e38d38eded6917a40a261e74a0fb73a2ebf280f35f8530134d3dd1f3fa696eb12ff8c0f978f248a88818bcc3a6e8d97eb9369
7
+ data.tar.gz: 1f1d0747ab6b8e8429870e4db6ae03441ddf8f9c56267146ee3522947c8ecdd860dcdcf49fd88b5b0af9cf622fd16a25ce99a244605f5ef1f2da905dc05e972a
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Karafka Test gem changelog
2
2
 
3
+ ## 2.1.2 (2023-06-13)
4
+ - [Enhancement] Depend on WaterDrop `>=` `2.6.0` directly and not via Karafka to make sure correct version is used.
5
+ - [Fix] Use proper WaterDrop `>=` `2.6.0` buffered client reference.
6
+
3
7
  ## 2.1.1 (2023-06-07)
4
8
  - [Enhancement] Support WaterDrop stubs with Mocha.
5
9
 
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-testing (2.1.1)
4
+ karafka-testing (2.1.2)
5
5
  karafka (>= 2.1.0, < 3.0.0)
6
+ waterdrop (>= 2.6.0)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
@@ -14,18 +15,18 @@ GEM
14
15
  thor (>= 0.20)
15
16
  waterdrop (>= 2.4.10, < 3.0.0)
16
17
  zeitwerk (~> 2.3)
17
- karafka-core (2.0.12)
18
+ karafka-core (2.0.13)
18
19
  concurrent-ruby (>= 1.1)
19
- karafka-rdkafka (>= 0.12.1)
20
- karafka-rdkafka (0.12.1)
20
+ karafka-rdkafka (>= 0.12.3)
21
+ karafka-rdkafka (0.12.3)
21
22
  ffi (~> 1.15)
22
23
  mini_portile2 (~> 2.6)
23
24
  rake (> 12)
24
25
  mini_portile2 (2.8.1)
25
26
  rake (13.0.6)
26
27
  thor (1.2.1)
27
- waterdrop (2.5.1)
28
- karafka-core (>= 2.0.12, < 3.0.0)
28
+ waterdrop (2.6.0)
29
+ karafka-core (>= 2.0.13, < 3.0.0)
29
30
  zeitwerk (~> 2.3)
30
31
  zeitwerk (2.6.7)
31
32
 
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
  end
26
26
 
27
27
  spec.add_dependency 'karafka', '>= 2.1.0', '< 3.0.0'
28
+ spec.add_dependency 'waterdrop', '>= 2.6.0'
28
29
 
29
30
  spec.metadata = {
30
31
  'funding_uri' => 'https://karafka.io/#become-pro',
@@ -3,40 +3,21 @@
3
3
  module Karafka
4
4
  module Testing
5
5
  # Spec producer client used to buffer messages that we send out in specs
6
- class SpecProducerClient < ::WaterDrop::Producer::DummyClient
7
- attr_accessor :messages
8
-
9
- # Sync fake response for the message delivery to Kafka, since we do not dispatch anything
10
- class SyncResponse
11
- # @param _args Handler wait arguments (irrelevant as waiting is fake here)
12
- def wait(*_args)
13
- false
14
- end
15
- end
16
-
6
+ class SpecProducerClient < ::WaterDrop::Clients::Buffered
17
7
  # @param rspec [RSpec::Core::ExampleGroup] rspec example we need to hold to trigger actions
18
8
  # on it that are rspec context aware
19
9
  def initialize(rspec)
20
- super()
10
+ super(nil)
21
11
  @rspec = rspec
22
- self.messages = []
23
12
  end
24
13
 
25
14
  # "Produces" message to Kafka. That is, it acknowledges it locally, adds it to the internal
26
15
  # buffer and adds it (if needed) into the current consumer messages buffer
27
16
  # @param message [Hash] `Karafka.producer.produce_sync` message hash
28
17
  def produce(message)
29
- messages << message
30
-
31
18
  @rspec._karafka_add_message_to_consumer_if_needed(message)
32
19
 
33
- SyncResponse.new
34
- end
35
-
36
- # Clears internal buffer
37
- # Used in between specs so messages do not leak out
38
- def reset
39
- messages.clear
20
+ super
40
21
  end
41
22
  end
42
23
  end
@@ -4,6 +4,6 @@
4
4
  module Karafka
5
5
  module Testing
6
6
  # Current version of gem. It should match Karafka framework version
7
- VERSION = '2.1.1'
7
+ VERSION = '2.1.2'
8
8
  end
9
9
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
36
36
  MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
37
37
  -----END CERTIFICATE-----
38
- date: 2023-06-07 00:00:00.000000000 Z
38
+ date: 2023-06-13 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: karafka
@@ -57,6 +57,20 @@ dependencies:
57
57
  - - "<"
58
58
  - !ruby/object:Gem::Version
59
59
  version: 3.0.0
60
+ - !ruby/object:Gem::Dependency
61
+ name: waterdrop
62
+ requirement: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 2.6.0
67
+ type: :runtime
68
+ prerelease: false
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 2.6.0
60
74
  description: Library which provides helpers for easier Karafka consumers tests
61
75
  email:
62
76
  - contact@karafka.io
metadata.gz.sig CHANGED
Binary file