karafka-testing 2.1.0 → 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: ffde2b857a9458b775eba84baaedb83a81fef050c484370f8c0156a71aee763d
4
- data.tar.gz: 52227a01c8ff61c50db492ecfd469e42d1d24ce8e46740ffd8df49e3f69d1293
3
+ metadata.gz: eeeff63f4e69e293379802fe9359ad9fa431f7e9c805c090e985cb53c92b7b16
4
+ data.tar.gz: 8dae650679708a37c060c9b2e45b7996a2b8330b7bbf1668ba248643d6bb33d0
5
5
  SHA512:
6
- metadata.gz: b5ab336e1f578c9c918678d614226600ad4f14eb5dcf9404dfd0d6749b4f66d4fd62cf0372263bfb063fa948de1b2aeb47d9c374b5fe2fbf87ebe02b47a9dfef
7
- data.tar.gz: 4be00387b896b5b29fbbcdc5481827e736bbc8eed9ddd2cfac773bf542fe2ad7db7a385dadd5d59ade7f15f637e40be8459d0094b6f25f648d29905fe2d55599
6
+ metadata.gz: f26ac82183a7e57e63b37e59964e38d38eded6917a40a261e74a0fb73a2ebf280f35f8530134d3dd1f3fa696eb12ff8c0f978f248a88818bcc3a6e8d97eb9369
7
+ data.tar.gz: 1f1d0747ab6b8e8429870e4db6ae03441ddf8f9c56267146ee3522947c8ecdd860dcdcf49fd88b5b0af9cf622fd16a25ce99a244605f5ef1f2da905dc05e972a
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,7 +1,14 @@
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
+
7
+ ## 2.1.1 (2023-06-07)
8
+ - [Enhancement] Support WaterDrop stubs with Mocha.
9
+
3
10
  ## 2.1.0 (2023-05-22)
4
- - Align Karafka expectations to match `2.1.0`.
11
+ - [Maintenance] Align Karafka expectations to match `2.1.0`.
5
12
 
6
13
  ## 2.0.11 (2023-04-13)
7
14
  - Align metadata builder format with Karafka `2.0.40`.
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-testing (2.1.0)
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',
@@ -33,7 +33,11 @@ module Karafka
33
33
  _karafka_consumer_messages.clear
34
34
  _karafka_producer_client.reset
35
35
 
36
- allow(Karafka.producer).to receive(:client).and_return(_karafka_producer_client)
36
+ if Object.const_defined?('Mocha', false)
37
+ Karafka.producer.stubs(:client).returns(_karafka_producer_client)
38
+ else
39
+ allow(Karafka.producer).to receive(:client).and_return(_karafka_producer_client)
40
+ end
37
41
  end
38
42
  end
39
43
  end
@@ -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.0'
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.0
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-05-22 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
@@ -1,2 +1 @@
1
- 5�?���屄r
2
- ���"5B�>s5�P�(V{���G���<��%�������}M�rd)�&��������ɡ+��^~�"m$.I�� $)چ �C"�]� BA�� ��E���Y���$��$�+��[�k�Q2 ء�� h��tk�N����0S���{��z6K0���F�g�+d��7��]$��n$i�zp��b+yҍ t1L����ˍ�+<�X���2у��pѸ�=�����t��^e �
1
+ 3�_ϵu��~��0lhʍm�L^�;��`��B:N3(Ov�+�p��9NT{��`���k�?0��s ^ۊ���1�U��=�A ����I��,�w�����g~�6d9[CT���� �O�0���7)|�3�c�ǟ�5�~Uߘv��0yBX�oZ`*�"TrYѣ�ī�\�kl��{$�,�+�a�q�6��c!��IDն���&��M�5���W����Ŷ^U��$�`QK��M�W�]�?�P%Kv���9ៃ׻���{7A�a^!RO�.���1��� ������h�n\{-?ywY�=�o�lE�j��l}l�]�=��e���u�{X��1�6ݑmk?�4ij�!��.c�3�|�*�����F7��^\�ja�7$