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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +12 -21
- data/Gemfile.lock +13 -13
- data/README.md +19 -1
- data/karafka-testing.gemspec +7 -3
- data/lib/karafka/testing/rspec/helpers.rb +4 -0
- data/lib/karafka/testing/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +8 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74a514259e50490b8e129aa929059c66db0b635ebd95ca4c30475cee0902ed4f
|
4
|
+
data.tar.gz: dd437d5114413f6dd2a8653bc2c2d20b28cd9ef0565f6988c3b61f39a9dd98f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
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
|
-
|
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.
|
5
|
-
karafka (~> 2.0.
|
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.
|
11
|
-
dry-configurable (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.
|
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.
|
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.
|
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
|
57
|
+
waterdrop (>= 2.3.1, < 3.0.0)
|
58
58
|
zeitwerk (~> 2.3)
|
59
|
-
mini_portile2 (2.
|
59
|
+
mini_portile2 (2.8.0)
|
60
60
|
rake (13.0.6)
|
61
|
-
rdkafka (0.
|
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
|
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.
|
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.
|
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
|
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!
|
data/karafka-testing.gemspec
CHANGED
@@ -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.
|
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.
|
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
|
|
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.
|
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-
|
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.
|
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.
|
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/
|
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.
|
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.
|
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
|