karafka-testing 2.0.0.alpha1 → 2.0.0.alpha4

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: 99b31b45b503aded03f25274fc7819219b3707644cbfa57a6136426351b52ae1
4
- data.tar.gz: 1321c4e974d9dcd25f9f38fb0b8237a503d3f4399cc08ea299820d6dd8ce2479
3
+ metadata.gz: 74a514259e50490b8e129aa929059c66db0b635ebd95ca4c30475cee0902ed4f
4
+ data.tar.gz: dd437d5114413f6dd2a8653bc2c2d20b28cd9ef0565f6988c3b61f39a9dd98f6
5
5
  SHA512:
6
- metadata.gz: aeb543efd92f2c9c7cafb50bb389e8d0baf388ce086cbe8751b2a2362d1e666c96766f771ff3fe20d38fcc9d3f8b69563073d4709fc93d756c880cbf4c6646e1
7
- data.tar.gz: c5eb1aaeeedeb7ab8c08e77998422b5a249069818b50abc842e9cf0d9599b59f07d88167e71c4d9791f62e979babb15b659816fb9249a8927e11e65909d40e1f
6
+ metadata.gz: 26feeacc3ca666fccd40b1f288b5b9621f31c9ba694daf423e7bbff400c07a1ba57afecf3ce2fc50b7e5347897c05635d30fb3aff5f036b7d093f93ed4a9d2ad
7
+ data.tar.gz: fb82d4df6d857a40ffaa061ecd86f478b55282b48e019fc905f237cbd2a5deec8ff44603c2979a1224e15211cdea55cfaafc0e0a3865feed944224064377c06d
checksums.yaml.gz.sig CHANGED
Binary file
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.1.2
data/CHANGELOG.md CHANGED
@@ -1,29 +1,20 @@
1
1
  # Karafka Test gem changelog
2
2
 
3
+ ## 2.0.0.alpha4 (2022-07-06)
4
+ - Require Karafka `2.0.0.beta5` and fix non-existing coordinator reference
5
+
6
+ ## 2.0.0.alpha3 (2022-03-14)
7
+ - Provide support for referencing producer from consumer
8
+
9
+ ## 2.0.0.alpha2 (2022-02-19)
10
+ - Add `rubygems_mfa_required`
11
+
3
12
  ## 2.0.0.alpha1 (2022-01-30)
4
13
  - Change the API to be more comprehensive
5
14
  - Update to work with Karafka 2.0
6
15
  - Support for Ruby 3.1
16
+ - Drop support for ruby 2.6
7
17
 
8
- ## 1.4.2 (2021-04-21)
9
- - Restore MIT license
10
- - Remove Ruby 2.5 support and update minimum Ruby requirement to 2.6
11
-
12
- ## 1.4.1 (2020-09-05)
13
- - Fix for Ruby 2.5 and 2.6 support
14
-
15
- ## 1.4.0 (2020-09-05)
16
- - Update to match Karafka 1.4.0 params and batch metadata setup
17
-
18
- ## 1.3.1 (2020-04-24)
19
- - change license to LGPL-3.0
20
- - Ruby 2.6.5 support
21
- - Ruby 2.7.1 support
22
- - JRuby support
23
- - Change license to LGPL-3.0
24
-
25
- ## 1.3.0 (2019-09-09)
26
- - Dynamic `App` name (#2)
18
+ ## 1.4.*
27
19
 
28
- ## 1.3.0.rc1 (2019-07-31)
29
- - Support for Karafka 1.3
20
+ If you are looking for the changelog of `1.4`, please go [here](https://github.com/karafka/testing/blob/1.4/CHANGELOG.md).
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-testing (2.0.0.alpha1)
5
- karafka (~> 2.0.alpha1)
4
+ karafka-testing (2.0.0.alpha4)
5
+ karafka (~> 2.0.beta5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- concurrent-ruby (1.1.9)
11
- dry-configurable (0.14.0)
10
+ concurrent-ruby (1.1.10)
11
+ dry-configurable (0.15.0)
12
12
  concurrent-ruby (~> 1.0)
13
13
  dry-core (~> 0.6)
14
14
  dry-container (0.9.0)
@@ -28,7 +28,7 @@ GEM
28
28
  dry-configurable (~> 0.13, >= 0.13.0)
29
29
  dry-core (~> 0.5, >= 0.5)
30
30
  dry-events (~> 0.2)
31
- dry-schema (1.8.0)
31
+ dry-schema (1.9.3)
32
32
  concurrent-ruby (~> 1.0)
33
33
  dry-configurable (~> 0.13, >= 0.13.0)
34
34
  dry-core (~> 0.5, >= 0.5)
@@ -41,36 +41,36 @@ GEM
41
41
  dry-core (~> 0.5, >= 0.5)
42
42
  dry-inflector (~> 0.1, >= 0.1.2)
43
43
  dry-logic (~> 1.0, >= 1.0.2)
44
- dry-validation (1.7.0)
44
+ dry-validation (1.8.1)
45
45
  concurrent-ruby (~> 1.0)
46
46
  dry-container (~> 0.7, >= 0.7.1)
47
47
  dry-core (~> 0.5, >= 0.5)
48
48
  dry-initializer (~> 3.0)
49
49
  dry-schema (~> 1.8, >= 1.8.0)
50
50
  ffi (1.15.5)
51
- karafka (2.0.0.alpha1)
51
+ karafka (2.0.0.beta5)
52
52
  dry-configurable (~> 0.13)
53
53
  dry-monitor (~> 0.5)
54
54
  dry-validation (~> 1.7)
55
55
  rdkafka (>= 0.10)
56
56
  thor (>= 0.20)
57
- waterdrop (>= 2.1.0, < 3.0.0)
57
+ waterdrop (>= 2.3.1, < 3.0.0)
58
58
  zeitwerk (~> 2.3)
59
- mini_portile2 (2.7.1)
59
+ mini_portile2 (2.8.0)
60
60
  rake (13.0.6)
61
- rdkafka (0.11.1)
61
+ rdkafka (0.12.0)
62
62
  ffi (~> 1.15)
63
63
  mini_portile2 (~> 2.6)
64
64
  rake (> 12)
65
65
  thor (1.2.1)
66
- waterdrop (2.1.0)
66
+ waterdrop (2.3.1)
67
67
  concurrent-ruby (>= 1.1)
68
68
  dry-configurable (~> 0.13)
69
69
  dry-monitor (~> 0.5)
70
70
  dry-validation (~> 1.7)
71
71
  rdkafka (>= 0.10)
72
72
  zeitwerk (~> 2.3)
73
- zeitwerk (2.5.4)
73
+ zeitwerk (2.6.0)
74
74
 
75
75
  PLATFORMS
76
76
  x86_64-linux
@@ -79,4 +79,4 @@ DEPENDENCIES
79
79
  karafka-testing!
80
80
 
81
81
  BUNDLED WITH
82
- 2.3.5
82
+ 2.3.15
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Karafka Testing library
2
2
 
3
- **Note**: Documentation presented below works with not yet released Karafka `2.0`.
3
+ **Note**: Documentation presented below works with Karafka `2.0.0.alpha3` and higher.
4
4
 
5
5
  Please refer to [this](https://github.com/karafka/testing/tree/1.4) branch and its documentation for details about usage with Karafka `1.4`.
6
6
 
@@ -63,6 +63,24 @@ RSpec.describe InlineBatchConsumer do
63
63
  end
64
64
  ```
65
65
 
66
+ If your consumers use `producer` to dispatch messages, you can set up your expectations against it as well:
67
+
68
+ ```ruby
69
+ RSpec.describe InlineBatchConsumer do
70
+ subject(:consumer) { karafka.consumer_for(:inline_batch_data) }
71
+
72
+ before { karafka.publish({ 'number' => 1 }.to_json) }
73
+
74
+ it 'expects to dispatch async message to messages topic with value bigger by 1' do
75
+ expect(consumer.producer)
76
+ .to receive(:produce_async)
77
+ .with(topic: 'messages', payload: { number: 2 }.to_json)
78
+
79
+ consumer.consume
80
+ end
81
+ end
82
+ ```
83
+
66
84
  ## Note on contributions
67
85
 
68
86
  First, thank you for considering contributing to the Karafka ecosystem! It's people like you that make the open source community such a great community!
@@ -19,13 +19,17 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
20
  spec.require_paths = %w[lib]
21
21
  spec.cert_chain = %w[certs/mensfeld.pem]
22
- spec.metadata = { 'source_code_uri' => 'https://github.com/karafka/testing' }
23
22
 
24
- spec.required_ruby_version = '>= 2.6.0'
23
+ spec.required_ruby_version = '>= 2.7'
25
24
 
26
25
  if $PROGRAM_NAME.end_with?('gem')
27
26
  spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
28
27
  end
29
28
 
30
- spec.add_dependency 'karafka', '~> 2.0.alpha1'
29
+ spec.add_dependency 'karafka', '~> 2.0.beta5'
30
+
31
+ spec.metadata = {
32
+ 'source_code_uri' => 'https://github.com/karafka/karafka',
33
+ 'rubygems_mfa_required' => 'true'
34
+ }
31
35
  end
@@ -48,9 +48,13 @@ module Karafka
48
48
 
49
49
  raise Karafka::Testing::Errors::TopicNotFoundError, requested_topic unless selected_topic
50
50
 
51
+ coordinators = Karafka::Processing::CoordinatorsBuffer.new
52
+
51
53
  consumer = described_class.new
52
54
  consumer.topic = selected_topic
55
+ consumer.producer = Karafka::App.producer
53
56
  consumer.client = Karafka::Testing::DummyClient.new
57
+ consumer.coordinator = coordinators.find_or_create(requested_topic, 0)
54
58
  consumer
55
59
  end
56
60
 
@@ -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.0.0.alpha1'
7
+ VERSION = '2.0.0.alpha4'
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.0.0.alpha1
4
+ version: 2.0.0.alpha4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -34,7 +34,7 @@ cert_chain:
34
34
  R2P11bWoCtr70BsccVrN8jEhzwXngMyI2gVt750Y+dbTu1KgRqZKp/ECe7ZzPzXj
35
35
  pIy9vHxTANKYVyI4qj8OrFdEM5BQNu8oQpL0iQ==
36
36
  -----END CERTIFICATE-----
37
- date: 2022-01-30 00:00:00.000000000 Z
37
+ date: 2022-07-06 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: karafka
@@ -42,14 +42,14 @@ dependencies:
42
42
  requirements:
43
43
  - - "~>"
44
44
  - !ruby/object:Gem::Version
45
- version: 2.0.alpha1
45
+ version: 2.0.beta5
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: 2.0.alpha1
52
+ version: 2.0.beta5
53
53
  description: Library which provides helpers for easier Karafka consumers tests
54
54
  email:
55
55
  - maciej@mensfeld.pl
@@ -83,7 +83,8 @@ homepage: https://karafka.io
83
83
  licenses:
84
84
  - MIT
85
85
  metadata:
86
- source_code_uri: https://github.com/karafka/testing
86
+ source_code_uri: https://github.com/karafka/karafka
87
+ rubygems_mfa_required: 'true'
87
88
  post_install_message:
88
89
  rdoc_options: []
89
90
  require_paths:
@@ -92,14 +93,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
93
  requirements:
93
94
  - - ">="
94
95
  - !ruby/object:Gem::Version
95
- version: 2.6.0
96
+ version: '2.7'
96
97
  required_rubygems_version: !ruby/object:Gem::Requirement
97
98
  requirements:
98
99
  - - ">"
99
100
  - !ruby/object:Gem::Version
100
101
  version: 1.3.1
101
102
  requirements: []
102
- rubygems_version: 3.3.4
103
+ rubygems_version: 3.3.7
103
104
  signing_key:
104
105
  specification_version: 4
105
106
  summary: Library which provides helpers for easier Karafka consumers tests
metadata.gz.sig CHANGED
Binary file