karafka-testing 2.0.8 → 2.0.10
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 +7 -0
- data/Gemfile.lock +15 -15
- data/karafka-testing.gemspec +6 -1
- data/lib/karafka/testing/rspec/helpers.rb +12 -6
- data/lib/karafka/testing/version.rb +1 -1
- data/renovate.json +6 -0
- data.tar.gz.sig +0 -0
- metadata +11 -5
- 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: 47bb942313bc4b99ff13e86313ac89a00d5ce4366393b222e58a50be5bbe749a
|
4
|
+
data.tar.gz: ba7cf9f4cb8a6b50fe3c587de189850f1da36769c335fef1ec0fece722838e3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 123a851c462ef7d4db9c39d34e6fdacc598230f02903341624ca7dab8687cf592badf16f7645f0124938a3ed84db2a62cbb6de8129b2974db26ec29fc15298ac
|
7
|
+
data.tar.gz: 37073e91acbbd6f828d5552787fb4200582360246468c80ed77dc8a8896437e3fcb6723d7327cea5fc991ea4ea596a9957a4e9afe29475b057814c156df72cea
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Karafka Test gem changelog
|
2
2
|
|
3
|
+
## 2.0.10 (2023-04-11)
|
4
|
+
- Align with changes in Karafka `2.0.39`
|
5
|
+
- Replace direct `described_class` reference for consumer building with `topic.consumer` Karafka routing based one. This change will allow for usage of `karafka.consumer_for` from any specs.
|
6
|
+
|
7
|
+
## 2.0.9 (2023-02-10)
|
8
|
+
- Inject consumer strategy to the test consumer instance.
|
9
|
+
|
3
10
|
## 2.0.8 (2022-11-03)
|
4
11
|
- Do not lock Ruby and rely on `karafka-core` via `karafka`.
|
5
12
|
- Due to changes in the engine, lock to `2.0.20`.
|
data/Gemfile.lock
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
karafka-testing (2.0.
|
5
|
-
karafka (>= 2.0.
|
4
|
+
karafka-testing (2.0.10)
|
5
|
+
karafka (>= 2.0.39, < 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
concurrent-ruby (1.
|
10
|
+
concurrent-ruby (1.2.2)
|
11
11
|
ffi (1.15.5)
|
12
|
-
karafka (2.0.
|
13
|
-
karafka-core (>= 2.0.
|
12
|
+
karafka (2.0.39)
|
13
|
+
karafka-core (>= 2.0.12, < 3.0.0)
|
14
14
|
thor (>= 0.20)
|
15
|
-
waterdrop (>= 2.4.
|
15
|
+
waterdrop (>= 2.4.10, < 3.0.0)
|
16
16
|
zeitwerk (~> 2.3)
|
17
|
-
karafka-core (2.0.
|
17
|
+
karafka-core (2.0.12)
|
18
18
|
concurrent-ruby (>= 1.1)
|
19
|
-
rdkafka (>= 0.12)
|
20
|
-
|
21
|
-
rake (13.0.6)
|
22
|
-
rdkafka (0.12.0)
|
19
|
+
karafka-rdkafka (>= 0.12.1)
|
20
|
+
karafka-rdkafka (0.12.1)
|
23
21
|
ffi (~> 1.15)
|
24
22
|
mini_portile2 (~> 2.6)
|
25
23
|
rake (> 12)
|
24
|
+
mini_portile2 (2.8.1)
|
25
|
+
rake (13.0.6)
|
26
26
|
thor (1.2.1)
|
27
|
-
waterdrop (2.
|
28
|
-
karafka-core (>= 2.0.
|
27
|
+
waterdrop (2.5.1)
|
28
|
+
karafka-core (>= 2.0.12, < 3.0.0)
|
29
29
|
zeitwerk (~> 2.3)
|
30
|
-
zeitwerk (2.6.
|
30
|
+
zeitwerk (2.6.7)
|
31
31
|
|
32
32
|
PLATFORMS
|
33
33
|
arm64-darwin
|
@@ -37,4 +37,4 @@ DEPENDENCIES
|
|
37
37
|
karafka-testing!
|
38
38
|
|
39
39
|
BUNDLED WITH
|
40
|
-
2.4.
|
40
|
+
2.4.10
|
data/karafka-testing.gemspec
CHANGED
@@ -24,10 +24,15 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
|
25
25
|
end
|
26
26
|
|
27
|
-
spec.add_dependency 'karafka', '>= 2.0.
|
27
|
+
spec.add_dependency 'karafka', '>= 2.0.39', '< 3.0.0'
|
28
28
|
|
29
29
|
spec.metadata = {
|
30
|
+
'funding_uri' => 'https://karafka.io/#become-pro',
|
31
|
+
'homepage_uri' => 'https://karafka.io',
|
32
|
+
'changelog_uri' => 'https://github.com/karafka/karafka-testing/blob/master/CHANGELOG.md',
|
33
|
+
'bug_tracker_uri' => 'https://github.com/karafka/karafka-testing/issues',
|
30
34
|
'source_code_uri' => 'https://github.com/karafka/karafka-testing',
|
35
|
+
'documentation_uri' => 'https://karafka.io/docs',
|
31
36
|
'rubygems_mfa_required' => 'true'
|
32
37
|
}
|
33
38
|
end
|
@@ -44,7 +44,7 @@ module Karafka
|
|
44
44
|
# create a consumer instance
|
45
45
|
# @param requested_consumer_group [String, Symbol, nil] optional name of the consumer group
|
46
46
|
# if we have multiple consumer groups listening on the same topic
|
47
|
-
# @return [Object]
|
47
|
+
# @return [Object] Karafka consumer instance
|
48
48
|
# @raise [Karafka::Testing::Errors::TopicNotFoundError] raised when we're unable to find
|
49
49
|
# topic that was requested
|
50
50
|
#
|
@@ -68,7 +68,7 @@ module Karafka
|
|
68
68
|
raise Errors::TopicInManyConsumerGroupsError, requested_topic if selected_topics.size > 1
|
69
69
|
raise Errors::TopicNotFoundError, requested_topic if selected_topics.empty?
|
70
70
|
|
71
|
-
_karafka_build_consumer_for(selected_topics.first)
|
71
|
+
_karafka_build_consumer_for(selected_topics.first, all_topics)
|
72
72
|
end
|
73
73
|
|
74
74
|
# Adds a new Karafka message instance if needed with given payload and options into an
|
@@ -160,13 +160,19 @@ module Karafka
|
|
160
160
|
# Builds the consumer instance based on the provided topic
|
161
161
|
#
|
162
162
|
# @param topic [Karafka::Routing::Topic] topic for which we want to build the consumer
|
163
|
+
# @param topics_array [Array<Karafka::Routing::Topic>] all the topics for coordinators
|
164
|
+
# buffer.
|
163
165
|
# @return [Object] karafka consumer
|
164
|
-
def _karafka_build_consumer_for(topic)
|
165
|
-
coordinators = Karafka::Processing::CoordinatorsBuffer.new
|
166
|
+
def _karafka_build_consumer_for(topic, topics_array)
|
167
|
+
coordinators = Karafka::Processing::CoordinatorsBuffer.new(
|
168
|
+
Karafka::Routing::Topics.new(topics_array)
|
169
|
+
)
|
166
170
|
|
167
|
-
consumer =
|
168
|
-
consumer.topic = topic
|
171
|
+
consumer = topic.consumer.new
|
169
172
|
consumer.producer = Karafka::App.producer
|
173
|
+
# Inject appropriate strategy so needed options and components are available
|
174
|
+
strategy = Karafka::App.config.internal.processing.strategy_selector.find(topic)
|
175
|
+
consumer.singleton_class.include(strategy)
|
170
176
|
consumer.client = _karafka_consumer_client
|
171
177
|
consumer.coordinator = coordinators.find_or_create(topic.name, 0)
|
172
178
|
consumer.coordinator.seek_offset = 0
|
data/renovate.json
ADDED
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.
|
4
|
+
version: 2.0.10
|
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-
|
38
|
+
date: 2023-04-11 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: karafka
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 2.0.
|
46
|
+
version: 2.0.39
|
47
47
|
- - "<"
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: 3.0.0
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
requirements:
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 2.0.
|
56
|
+
version: 2.0.39
|
57
57
|
- - "<"
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: 3.0.0
|
@@ -88,11 +88,17 @@ files:
|
|
88
88
|
- lib/karafka/testing/spec_consumer_client.rb
|
89
89
|
- lib/karafka/testing/spec_producer_client.rb
|
90
90
|
- lib/karafka/testing/version.rb
|
91
|
+
- renovate.json
|
91
92
|
homepage: https://karafka.io
|
92
93
|
licenses:
|
93
94
|
- MIT
|
94
95
|
metadata:
|
96
|
+
funding_uri: https://karafka.io/#become-pro
|
97
|
+
homepage_uri: https://karafka.io
|
98
|
+
changelog_uri: https://github.com/karafka/karafka-testing/blob/master/CHANGELOG.md
|
99
|
+
bug_tracker_uri: https://github.com/karafka/karafka-testing/issues
|
95
100
|
source_code_uri: https://github.com/karafka/karafka-testing
|
101
|
+
documentation_uri: https://karafka.io/docs
|
96
102
|
rubygems_mfa_required: 'true'
|
97
103
|
post_install_message:
|
98
104
|
rdoc_options: []
|
@@ -109,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
115
|
- !ruby/object:Gem::Version
|
110
116
|
version: '0'
|
111
117
|
requirements: []
|
112
|
-
rubygems_version: 3.4.
|
118
|
+
rubygems_version: 3.4.10
|
113
119
|
signing_key:
|
114
120
|
specification_version: 4
|
115
121
|
summary: Library which provides helpers for easier Karafka consumers tests
|
metadata.gz.sig
CHANGED
Binary file
|