karafka-testing 2.4.1 → 2.4.3
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/CHANGELOG.md +9 -1
- data/Gemfile.lock +1 -1
- data/lib/karafka/testing/minitest/helpers.rb +14 -3
- data/lib/karafka/testing/rspec/helpers.rb +13 -3
- data/lib/karafka/testing/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: fe477f5bd2b71d1114928a4db25c35f6fffe0a4eed5265eca11bbdaf631be953
|
4
|
+
data.tar.gz: 30fa033178bdb55bcca8cbce705a5f91224380bb6900c2998b78da50af2291d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbcb1174a90f12d0743474462802e495674627d34f60499cdbc28d48214512371a2532c71e7d94a2a565d4513c3161807e82f117f11d83e38f1aad11fc0f5f6a
|
7
|
+
data.tar.gz: f621736a76fd8c2f20ab8908e1f1addc43e1913027cdd67d9a077e93a014f581f9a97d3b028d8b18eaee1246feb3a6d14abaddf3de766e17b7c3b47541f974c5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# Karafka Test gem changelog
|
2
2
|
|
3
|
-
## 2.4.
|
3
|
+
## 2.4.3 (2024-05-06)
|
4
|
+
- [Fix] Fix: raw_key is not being assigned for rspec (CaioPenhalver)
|
5
|
+
- [Fix] Fix: raw_key is not being assigned for minitest
|
6
|
+
- [Fix] Fix: headers is not being assigned for minitest and rspec
|
7
|
+
|
8
|
+
## 2.4.2 (2024-04-30)
|
9
|
+
- [Fix] Fix FrozenError when accessing key and headers in `Karafka::Messages::Metadata` (tldn0718)
|
10
|
+
|
11
|
+
## 2.4.1 (2024-04-29)
|
4
12
|
- [Fix] Fix instance variable in minitest helper (tldn0718)
|
5
13
|
|
6
14
|
## 2.4.0 (2024-04-26)
|
data/Gemfile.lock
CHANGED
@@ -14,6 +14,14 @@ module Karafka
|
|
14
14
|
module Minitest
|
15
15
|
# Minitest helpers module that needs to be included
|
16
16
|
module Helpers
|
17
|
+
# Map to convert dispatch attributes into their "delivery" format, since we bypass Kafka
|
18
|
+
METADATA_DISPATCH_MAPPINGS = {
|
19
|
+
raw_key: :key,
|
20
|
+
raw_headers: :headers
|
21
|
+
}.freeze
|
22
|
+
|
23
|
+
private_constant :METADATA_DISPATCH_MAPPINGS
|
24
|
+
|
17
25
|
class << self
|
18
26
|
# Adds all the needed extra functionalities to the minitest group
|
19
27
|
# @param base [Class] Minitest example group we want to extend
|
@@ -93,14 +101,17 @@ module Karafka
|
|
93
101
|
metadata = _karafka_message_metadata_defaults
|
94
102
|
|
95
103
|
metadata.keys.each do |key|
|
96
|
-
|
104
|
+
message_key = METADATA_DISPATCH_MAPPINGS.fetch(key, key)
|
97
105
|
|
98
|
-
|
106
|
+
next unless message.key?(message_key)
|
107
|
+
|
108
|
+
metadata[key] = message.fetch(message_key)
|
99
109
|
end
|
110
|
+
|
100
111
|
# Add this message to previously produced messages
|
101
112
|
@_karafka_consumer_messages << Karafka::Messages::Message.new(
|
102
113
|
message[:payload],
|
103
|
-
Karafka::Messages::Metadata.new(metadata)
|
114
|
+
Karafka::Messages::Metadata.new(metadata)
|
104
115
|
)
|
105
116
|
# Update batch metadata
|
106
117
|
batch_metadata = Karafka::Messages::Builders::BatchMetadata.call(
|
@@ -15,6 +15,14 @@ module Karafka
|
|
15
15
|
module RSpec
|
16
16
|
# RSpec helpers module that needs to be included
|
17
17
|
module Helpers
|
18
|
+
# Map to convert dispatch attributes into their "delivery" format, since we bypass Kafka
|
19
|
+
METADATA_DISPATCH_MAPPINGS = {
|
20
|
+
raw_key: :key,
|
21
|
+
raw_headers: :headers
|
22
|
+
}.freeze
|
23
|
+
|
24
|
+
private_constant :METADATA_DISPATCH_MAPPINGS
|
25
|
+
|
18
26
|
class << self
|
19
27
|
# Adds all the needed extra functionalities to the rspec group
|
20
28
|
# @param base [Class] RSpec example group we want to extend
|
@@ -100,15 +108,17 @@ module Karafka
|
|
100
108
|
metadata = _karafka_message_metadata_defaults
|
101
109
|
|
102
110
|
metadata.keys.each do |key|
|
103
|
-
|
111
|
+
message_key = METADATA_DISPATCH_MAPPINGS.fetch(key, key)
|
112
|
+
|
113
|
+
next unless message.key?(message_key)
|
104
114
|
|
105
|
-
metadata[key] = message.fetch(
|
115
|
+
metadata[key] = message.fetch(message_key)
|
106
116
|
end
|
107
117
|
|
108
118
|
# Add this message to previously produced messages
|
109
119
|
_karafka_consumer_messages << Karafka::Messages::Message.new(
|
110
120
|
message[:payload],
|
111
|
-
Karafka::Messages::Metadata.new(metadata)
|
121
|
+
Karafka::Messages::Metadata.new(metadata)
|
112
122
|
)
|
113
123
|
|
114
124
|
# Update batch metadata
|
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.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
|
36
36
|
msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-
|
38
|
+
date: 2024-05-06 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: karafka
|
metadata.gz.sig
CHANGED
Binary file
|