karafka-testing 2.5.1 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36716dda84a866c1016f5b4372e26558f84813025e35c47709e0e6fed118e65b
4
- data.tar.gz: 73e97a1b77b94fb0c14230386f1a1a89f197556a1b887aa7bd36aeed7a698244
3
+ metadata.gz: ec0f7907a4fc370e0ee093df0b7759537977de1e54e4873149f8a784f6126e04
4
+ data.tar.gz: 8ca3cb6784c6d2def64c4495d2f9318426c023499c401a01e33e295d27583c7e
5
5
  SHA512:
6
- metadata.gz: 8cb230d52c37840322b76e4ff9765a9beba2fdece357afac9bfef39ac2494185a2d480b902a183ff0d69b4855da5d92ce7be9459f47588126abb5a43a62c7547
7
- data.tar.gz: 74f58aaa140a67d49193d02e655357780edbbd70f8a28738889be1ffa494cffa3e9e615e4d1cd221678bfb1258bc32816444cf7787a2a52e01283bb4a7612749
6
+ metadata.gz: c61db348f3acb74d3eb3f7a9b807974ae9af1dc00d10e1dcd6f2e3c9dd006bf0f6937ebfd857e9dd51499968cf2e3c075cb9b073226acd0b19449755169c6271
7
+ data.tar.gz: ed1482d93ea2532a5d9123fe05d1ef62157e33d8a8ff9be70fd8434c9fcd30031652e7a0d3ae093398942d183e97a4577bb8a06e7481aa05f39e9073b0b1ccf9
@@ -1,4 +1,4 @@
1
- name: ci
1
+ name: CI
2
2
 
3
3
  concurrency:
4
4
  group: ${{ github.workflow }}-${{ github.ref }}
@@ -24,7 +24,8 @@ jobs:
24
24
  fail-fast: false
25
25
  matrix:
26
26
  ruby:
27
- - '3.4.0-preview2'
27
+ - '3.5.0-preview1'
28
+ - '3.4'
28
29
  - '3.3'
29
30
  - '3.2'
30
31
  - '3.1'
@@ -40,7 +41,7 @@ jobs:
40
41
  run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
41
42
 
42
43
  - name: Set up Ruby
43
- uses: ruby/setup-ruby@bb0f760b6c925183520ee0bcc9c4a432a7c8c3c6 # v1.241.0
44
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
44
45
  with:
45
46
  ruby-version: ${{matrix.ruby}}
46
47
  bundler: 'latest'
@@ -66,7 +67,7 @@ jobs:
66
67
  fetch-depth: 0
67
68
 
68
69
  - name: Set up Ruby
69
- uses: ruby/setup-ruby@bb0f760b6c925183520ee0bcc9c4a432a7c8c3c6 # v1.241.0
70
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
70
71
  with:
71
72
  ruby-version: 3.3
72
73
 
@@ -24,7 +24,7 @@ jobs:
24
24
  fetch-depth: 0
25
25
 
26
26
  - name: Set up Ruby
27
- uses: ruby/setup-ruby@bb0f760b6c925183520ee0bcc9c4a432a7c8c3c6 # v1.241.0
27
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
28
28
  with:
29
29
  bundler-cache: false
30
30
 
@@ -0,0 +1,30 @@
1
+ name: Trigger Wiki Refresh
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ push:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ trigger-wiki-refresh:
11
+ runs-on: ubuntu-latest
12
+ environment: wiki-trigger
13
+ if: github.repository_owner == 'karafka'
14
+ steps:
15
+ - name: Trigger wiki refresh
16
+ uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
17
+ with:
18
+ token: ${{ secrets.WIKI_REPO_TOKEN }}
19
+ repository: karafka/wiki
20
+ event-type: sync-trigger
21
+ client-payload: |
22
+ {
23
+ "repository": "${{ github.repository }}",
24
+ "event_name": "${{ github.event_name }}",
25
+ "release_tag": "${{ github.event.release.tag_name || '' }}",
26
+ "release_name": "${{ github.event.release.name || '' }}",
27
+ "commit_sha": "${{ github.sha }}",
28
+ "commit_message": "Trigger Wiki Refresh",
29
+ "triggered_by": "${{ github.actor }}"
30
+ }
@@ -4,7 +4,7 @@ on:
4
4
  paths:
5
5
  - '.github/workflows/**'
6
6
  jobs:
7
- verify:
7
+ verify_action_pins:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
10
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.4
1
+ 3.4.5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Karafka Testing Changelog
2
2
 
3
+ ## 2.5.3 (2025-08-12)
4
+ - [Fix] Allow testing consumers with Pro expansions (i.e. Piping).
5
+
6
+ ## 2.5.2 (2025-08-04)
7
+ - [Enhancement] Change RSpec hook execution order issue in Karafka testing helpers.
8
+ - [Change] Remove `funding_uri` from the gemspec to minimize double-funding info.
9
+ - [Change] Add new CI action to trigger auto-doc refresh.
10
+
3
11
  ## 2.5.1 (2025-05-25)
4
12
  - [Change] Move to trusted-publishers and remove signing since no longer needed.
5
13
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-testing (2.5.1)
4
+ karafka-testing (2.5.3)
5
5
  karafka (>= 2.5.0.beta1, < 2.6.0)
6
6
  waterdrop (>= 2.8.0)
7
7
 
@@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = '>= 3.1.0'
26
26
 
27
27
  spec.metadata = {
28
- 'funding_uri' => 'https://karafka.io/#become-pro',
29
28
  'homepage_uri' => 'https://karafka.io',
30
29
  'changelog_uri' => 'https://karafka.io/docs/Changelog-Karafka-Testing',
31
30
  'bug_tracker_uri' => 'https://github.com/karafka/karafka-testing/issues',
@@ -190,6 +190,7 @@ module Karafka
190
190
  coordinators = Karafka::Processing::CoordinatorsBuffer.new(
191
191
  Karafka::Routing::Topics.new([topic])
192
192
  )
193
+ processing_cfg = Karafka::App.config.internal.processing
193
194
  @consumer = topic.consumer.new
194
195
  @consumer.producer = Karafka::App.producer
195
196
  # Inject appropriate strategy so needed options and components are available
@@ -200,6 +201,8 @@ module Karafka
200
201
  @consumer.coordinator.seek_offset = 0
201
202
  # Indicate usage as for tests no direct enqueuing happens
202
203
  @consumer.instance_variable_set('@used', true)
204
+ expansions = processing_cfg.expansions_selector.find(topic)
205
+ expansions.each { |expansion| @consumer.singleton_class.include(expansion) }
203
206
  @_karafka_consumer_mappings[topic.name] = @consumer
204
207
  @consumer
205
208
  end
@@ -39,9 +39,14 @@ module Karafka
39
39
  # Producer fake client to mock communication with Kafka
40
40
  base.let(:_karafka_producer_client) { Karafka::Testing::SpecProducerClient.new(self) }
41
41
 
42
- base.prepend_before do
42
+ base.before(:context) do
43
43
  Karafka::Testing.ensure_karafka_initialized!
44
+ @_karafka_shared_producer_client = WaterDrop::Clients::Dummy.new(-1)
45
+ Karafka.producer.instance_variable_set(:'@client', @_karafka_shared_producer_client)
46
+ Karafka.producer.instance_variable_set(:'@pid', ::Process.pid)
47
+ end
44
48
 
49
+ base.prepend_before do
45
50
  _karafka_consumer_messages.clear
46
51
  _karafka_producer_client.reset
47
52
  @_karafka_consumer_mappings = {}
@@ -196,16 +201,19 @@ module Karafka
196
201
  Karafka::Routing::Topics.new([topic])
197
202
  )
198
203
 
204
+ processing_cfg = Karafka::App.config.internal.processing
199
205
  consumer = topic.consumer.new
200
206
  consumer.producer = Karafka::App.producer
201
207
  # Inject appropriate strategy so needed options and components are available
202
- strategy = Karafka::App.config.internal.processing.strategy_selector.find(topic)
208
+ strategy = processing_cfg.strategy_selector.find(topic)
203
209
  consumer.singleton_class.include(strategy)
204
210
  consumer.client = _karafka_consumer_client
205
211
  consumer.coordinator = coordinators.find_or_create(topic.name, 0)
206
212
  consumer.coordinator.seek_offset = 0
207
213
  # Indicate usage as for tests no direct enqueuing happens
208
214
  consumer.instance_variable_set('@used', true)
215
+ expansions = processing_cfg.expansions_selector.find(topic)
216
+ expansions.each { |expansion| consumer.singleton_class.include(expansion) }
209
217
 
210
218
  @_karafka_consumer_mappings[topic.name] = consumer
211
219
  consumer
@@ -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.5.1'
7
+ VERSION = '2.5.3'
8
8
  end
9
9
  end
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.5.1
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -58,6 +58,7 @@ files:
58
58
  - ".github/ISSUE_TEMPLATE/feature_request.md"
59
59
  - ".github/workflows/ci.yml"
60
60
  - ".github/workflows/push.yml"
61
+ - ".github/workflows/trigger-wiki-refresh.yml"
61
62
  - ".github/workflows/verify-action-pins.yml"
62
63
  - ".gitignore"
63
64
  - ".rspec"
@@ -87,7 +88,6 @@ homepage: https://karafka.io
87
88
  licenses:
88
89
  - MIT
89
90
  metadata:
90
- funding_uri: https://karafka.io/#become-pro
91
91
  homepage_uri: https://karafka.io
92
92
  changelog_uri: https://karafka.io/docs/Changelog-Karafka-Testing
93
93
  bug_tracker_uri: https://github.com/karafka/karafka-testing/issues
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.6.7
111
+ rubygems_version: 3.6.9
112
112
  specification_version: 4
113
113
  summary: Library which provides helpers for easier Karafka consumers tests
114
114
  test_files: []