msgr 1.3.2 → 1.5.0

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +83 -0
  3. data/.gitignore +17 -17
  4. data/.markdownlint.yml +22 -0
  5. data/.rubocop.yml +6 -2
  6. data/.vscode/ltex.dictionary.en-US.txt +1 -0
  7. data/Appraisals +13 -8
  8. data/CHANGELOG.md +85 -8
  9. data/Gemfile +1 -1
  10. data/README.md +17 -16
  11. data/gemfiles/rails_5.2.gemfile +2 -1
  12. data/gemfiles/rails_6.0.gemfile +2 -1
  13. data/gemfiles/rails_6.1.gemfile +2 -1
  14. data/gemfiles/rails_7.0.gemfile +15 -0
  15. data/gemfiles/{rails_master.gemfile → rails_head.gemfile} +2 -1
  16. data/lib/msgr/binding.rb +2 -2
  17. data/lib/msgr/channel.rb +2 -7
  18. data/lib/msgr/cli.rb +11 -12
  19. data/lib/msgr/client.rb +2 -2
  20. data/lib/msgr/connection.rb +2 -2
  21. data/lib/msgr/railtie.rb +1 -1
  22. data/lib/msgr/route.rb +2 -2
  23. data/lib/msgr/test_pool.rb +3 -3
  24. data/lib/msgr/version.rb +3 -3
  25. data/lib/msgr.rb +1 -3
  26. data/msgr.gemspec +6 -3
  27. data/renovate.json +5 -0
  28. data/scripts/simple_test.rb +1 -1
  29. data/spec/integration/dummy/app/consumers/test_consumer.rb +6 -1
  30. data/spec/integration/dummy/config/rabbitmq.yml +2 -0
  31. data/spec/integration/msgr/dispatcher_spec.rb +5 -6
  32. data/spec/integration/spec_helper.rb +7 -1
  33. data/spec/integration/test_controller_spec.rb +10 -2
  34. data/spec/unit/msgr/client_spec.rb +2 -2
  35. data/spec/unit/msgr/dispatcher_spec.rb +4 -4
  36. data/spec/unit/msgr/route_spec.rb +15 -1
  37. data/spec/unit/msgr/test_pool_spec.rb +14 -0
  38. data/spec/unit/msgr_spec.rb +3 -4
  39. metadata +14 -65
  40. data/.github/workflows/build.yml +0 -52
  41. data/.github/workflows/lint.yml +0 -20
  42. data/.travis.yml +0 -29
  43. data/spec/integration/dummy/db/test.sqlite3 +0 -0
data/lib/msgr/client.rb CHANGED
@@ -14,7 +14,7 @@ module Msgr
14
14
  @config = {
15
15
  host: '127.0.0.1',
16
16
  vhost: '/',
17
- max: 2
17
+ max: 2,
18
18
  }
19
19
 
20
20
  @config.merge! parse(config.delete(:uri)) if config[:uri]
@@ -148,7 +148,7 @@ module Msgr
148
148
 
149
149
  log(:warn) do
150
150
  "Fork detected. Reset internal state. (Old PID: #{@pid} / " \
151
- "New PID: #{::Process.pid}"
151
+ "New PID: #{::Process.pid}"
152
152
  end
153
153
 
154
154
  reset
@@ -87,8 +87,8 @@ module Msgr
87
87
  def bind(routes)
88
88
  if routes.empty?
89
89
  log(:warn) do
90
- "No routes to bound to. Bind will have no effect:\n" \
91
- " #{routes.inspect}"
90
+ "No routes to bound to. Bind will have no effect:\n " \
91
+ "#{routes.inspect}"
92
92
  end
93
93
  else
94
94
  bind_all(routes)
data/lib/msgr/railtie.rb CHANGED
@@ -24,7 +24,7 @@ module Msgr
24
24
  # Set defaults
25
25
  config.reverse_merge!(
26
26
  checkcredentials: true,
27
- routing_file: Rails.root.join('config/msgr.rb').to_s
27
+ routing_file: Rails.root.join('config/msgr.rb').to_s,
28
28
  )
29
29
 
30
30
  Msgr.config = config
data/lib/msgr/route.rb CHANGED
@@ -4,7 +4,7 @@ module Msgr
4
4
  class Route
5
5
  attr_reader :consumer, :action, :opts
6
6
 
7
- MATCH_REGEXP = /\A(?<consumer>\w+)#(?<action>\w+)\z/.freeze
7
+ MATCH_REGEXP = %r{\A(?<consumer>(?:\w+/)*\w+)#(?<action>\w+)\z}.freeze
8
8
  def initialize(key, opts = {})
9
9
  @opts = opts
10
10
  raise ArgumentError.new 'Missing `to` options.' unless @opts[:to]
@@ -16,7 +16,7 @@ module Msgr
16
16
  unless result
17
17
  raise ArgumentError.new \
18
18
  "Invalid consumer format: #{opts[:to].strip.to_s.inspect}. " \
19
- 'Must be `consumer_class#action`.'
19
+ 'Must be `name/space/consumer_class#action`.'
20
20
  end
21
21
 
22
22
  @consumer = "#{result[:consumer].camelize}Consumer"
@@ -60,12 +60,12 @@ module Msgr
60
60
  @instance ||= super(*args) # rubocop:disable Naming/MemoizedInstanceVariableName
61
61
  end
62
62
 
63
- def run(*args)
64
- new.run(*args)
63
+ def run(**kwargs)
64
+ new.run(**kwargs)
65
65
  end
66
66
 
67
67
  def clear
68
- @instance ? @instance.clear : nil
68
+ @instance&.clear
69
69
  end
70
70
 
71
71
  alias reset clear
data/lib/msgr/version.rb CHANGED
@@ -3,10 +3,10 @@
3
3
  module Msgr
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 3
7
- PATCH = 2
6
+ MINOR = 5
7
+ PATCH = 0
8
8
  STAGE = nil
9
- STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
9
+ STRING = [MAJOR, MINOR, PATCH, STAGE].compact.join('.')
10
10
 
11
11
  def self.to_s
12
12
  STRING
data/lib/msgr.rb CHANGED
@@ -25,7 +25,7 @@ require 'msgr/railtie' if defined? Rails
25
25
 
26
26
  module Msgr
27
27
  class << self
28
- attr_writer :client, :config
28
+ attr_writer :client, :config, :logger
29
29
 
30
30
  delegate :publish, to: :client
31
31
 
@@ -46,8 +46,6 @@ module Msgr
46
46
  @logger
47
47
  end
48
48
 
49
- attr_writer :logger
50
-
51
49
  def start
52
50
  client.start
53
51
  client
data/msgr.gemspec CHANGED
@@ -15,13 +15,16 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'https://github.com/jgraichen/msgr'
16
16
  spec.license = 'MIT'
17
17
 
18
+ spec.metadata = {
19
+ 'rubygems_mfa_required' => 'true',
20
+ }
21
+
18
22
  spec.files = `git ls-files -z`.split("\x0")
19
23
  spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
20
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
24
  spec.require_paths = %w[lib]
22
25
 
26
+ spec.required_ruby_version = '>= 2.7'
27
+
23
28
  spec.add_dependency 'activesupport'
24
29
  spec.add_dependency 'bunny', '>= 1.4', '< 3.0'
25
-
26
- spec.add_development_dependency 'bundler'
27
30
  end
data/renovate.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": [
3
+ "config:base"
4
+ ]
5
+ }
@@ -28,7 +28,7 @@ class NullPool
28
28
  end
29
29
 
30
30
  @client = Msgr::Client.new user: 'guest', password: 'guest',
31
- max: 4 # , pool_class: 'NullPool'
31
+ max: 4 # , pool_class: 'NullPool'
32
32
 
33
33
  @client.routes.configure do
34
34
  route 'abc.#', to: 'test#index'
@@ -1,6 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class TestConsumer < ApplicationConsumer
4
+ class << self
5
+ attr_accessor :queue
6
+ end
7
+
4
8
  def index
5
9
  data = {fuubar: 'abc'}
6
10
 
@@ -8,6 +12,7 @@ class TestConsumer < ApplicationConsumer
8
12
  end
9
13
 
10
14
  def another_action
11
- puts payload.inspect.to_s
15
+ self.class.queue ||= []
16
+ self.class.queue << payload
12
17
  end
13
18
  end
@@ -3,6 +3,8 @@ common: &common
3
3
 
4
4
  test:
5
5
  <<: *common
6
+ pool_class: Msgr::TestPool
7
+ raise_exceptions: true
6
8
 
7
9
  development:
8
10
  <<: *common
@@ -31,24 +31,23 @@ describe Msgr::Dispatcher do
31
31
  let(:config) { {max: 1} }
32
32
  let(:consumer) { 'DispatcherTestConsumer' }
33
33
  let(:route) do
34
- instance_double('Msgr::Route').tap do |t|
35
- allow(t).to receive(:consumer).and_return consumer
36
- allow(t).to receive(:action).and_return 'index'
34
+ instance_double(Msgr::Route).tap do |t|
35
+ allow(t).to receive_messages(consumer: consumer, action: 'index')
37
36
  end
38
37
  end
39
38
  let(:channel) do
40
- instance_double('Msgr::Channel').tap do |c|
39
+ instance_double(Msgr::Channel).tap do |c|
41
40
  allow(c).to receive(:ack)
42
41
  end
43
42
  end
44
43
  let(:delivery_info) do
45
- instance_double('Bunny::DeliveryInfo').tap do |ti|
44
+ instance_double(Bunny::DeliveryInfo).tap do |ti|
46
45
  allow(ti).to receive(:delivery_tag).and_return(3)
47
46
  end
48
47
  end
49
48
  let(:payload) { {} }
50
49
  let(:metadata) do
51
- instance_double('Bunny::MessageProperties').tap do |metadata|
50
+ instance_double(Bunny::MessageProperties).tap do |metadata|
52
51
  allow(metadata).to receive(:content_type).and_return('text/plain')
53
52
  end
54
53
  end
@@ -11,7 +11,7 @@ Coveralls.wear! do
11
11
  end
12
12
 
13
13
  ENV['RAILS_ENV'] ||= 'test'
14
- ENV['RAILS_GROUPS'] = ['rails', ENV['RAILS_GROUPS']].reject(&:nil?).join(',')
14
+ ENV['RAILS_GROUPS'] = ['rails', ENV.fetch('RAILS_GROUPS', nil)].compact.join(',')
15
15
  require File.expand_path('dummy/config/environment', __dir__)
16
16
  require 'rspec/rails'
17
17
 
@@ -50,4 +50,10 @@ RSpec.configure do |config|
50
50
  config.before do
51
51
  Msgr.logger = false
52
52
  end
53
+
54
+ config.after do
55
+ # Flush the consumer queue
56
+ Msgr.client.stop delete: true
57
+ Msgr::TestPool.reset
58
+ end
53
59
  end
@@ -2,8 +2,16 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- describe TestController, type: :request do
5
+ describe TestController, type: :controller do
6
+ before do
7
+ Msgr.client.start
8
+ end
9
+
6
10
  it 'sends messages on :index' do
7
- get '/'
11
+ get :index
12
+
13
+ Msgr::TestPool.run(count: 2)
14
+
15
+ expect(TestConsumer.queue).to eq [{fuubar: 'abc'}]
8
16
  end
9
17
  end
@@ -61,8 +61,8 @@ describe Msgr::Client do
61
61
  subject(:drain) { client.drain }
62
62
 
63
63
  let(:config) { {routing_file: 'spec/fixtures/msgr_routes_test_drain.rb'} }
64
- let(:channel_stub) { instance_double('Msgr::Channel', prefetch: true) }
65
- let(:queue_stub) { instance_double('Bunny::Queue', purge: true) }
64
+ let(:channel_stub) { instance_double(Msgr::Channel, prefetch: true) }
65
+ let(:queue_stub) { instance_double(Bunny::Queue, purge: true) }
66
66
 
67
67
  before do
68
68
  allow(Msgr::Channel).to receive(:new).and_return(channel_stub)
@@ -23,8 +23,8 @@ describe Msgr::Dispatcher do
23
23
 
24
24
  describe 'dispatch' do
25
25
  it 'acks messages automatically if auto_ack is enabled' do
26
- route_db = instance_double('Msgr::Route', consumer: 'MsgrAutoAckConsumer', action: :index)
27
- msg_db = instance_spy('Msgr::Message', route: route_db, acked?: false)
26
+ route_db = instance_double(Msgr::Route, consumer: 'MsgrAutoAckConsumer', action: :index)
27
+ msg_db = instance_spy(Msgr::Message, route: route_db, acked?: false)
28
28
 
29
29
  dispatcher.dispatch(msg_db)
30
30
 
@@ -33,8 +33,8 @@ describe Msgr::Dispatcher do
33
33
  end
34
34
 
35
35
  it 'does not ack messages if auto_ack is disabled' do
36
- route_db = instance_double('Msgr::Route', consumer: 'MsgrManualAckConsumer', action: :index)
37
- msg_db = instance_spy('Msgr::Message', route: route_db, acked?: false)
36
+ route_db = instance_double(Msgr::Route, consumer: 'MsgrManualAckConsumer', action: :index)
37
+ msg_db = instance_spy(Msgr::Message, route: route_db, acked?: false)
38
38
 
39
39
  dispatcher.dispatch(msg_db)
40
40
 
@@ -34,6 +34,12 @@ describe Msgr::Route do
34
34
  described_class.new routing_key, to: 'abc'
35
35
  end.to raise_error ArgumentError, /invalid consumer format/i
36
36
  end
37
+
38
+ it 'allows namespaces in consumer' do
39
+ expect do
40
+ described_class.new routing_key, to: 'abc/def#ghi'
41
+ end.not_to raise_error
42
+ end
37
43
  end
38
44
 
39
45
  describe '#consumer' do
@@ -44,10 +50,18 @@ describe Msgr::Route do
44
50
  context 'with underscore consumer name' do
45
51
  let(:options) { super().merge to: 'test_resource_foo#index' }
46
52
 
47
- it 'returns camelized method name' do
53
+ it 'returns camelized class name' do
48
54
  expect(route.consumer).to eq 'TestResourceFooConsumer'
49
55
  end
50
56
  end
57
+
58
+ context 'with nested namespace in consumer name' do
59
+ let(:options) { super().merge to: 'nested/namespace/foo#index' }
60
+
61
+ it 'returns fully classified, classified class name' do
62
+ expect(route.consumer).to eq 'Nested::Namespace::FooConsumer'
63
+ end
64
+ end
51
65
  end
52
66
 
53
67
  describe '#action' do
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Msgr::TestPool do
6
+ let(:pool) { described_class.new }
7
+
8
+ describe '.run' do
9
+ it 'passes through to #run' do
10
+ expect(pool).to receive(:run).with(count: 5) # rubocop:disable RSpec/MessageSpies
11
+ described_class.run(count: 5)
12
+ end
13
+ end
14
+ end
@@ -2,8 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- class Receiver
6
- end
5
+ Receiver = Class.new
7
6
 
8
7
  class MsgrTestConsumer < Msgr::Consumer
9
8
  def index
@@ -25,7 +24,7 @@ end
25
24
 
26
25
  describe Msgr do
27
26
  let(:queue) { Queue.new }
28
- let(:client) { Msgr::Client.new size: 1, prefix: SecureRandom.hex(2), uri: ENV['AMQP_SERVER'] }
27
+ let(:client) { Msgr::Client.new size: 1, prefix: SecureRandom.hex(2), uri: ENV.fetch('AMQP_SERVER', nil) }
29
28
 
30
29
  before do
31
30
  client.routes.configure do
@@ -86,7 +85,7 @@ describe Msgr do
86
85
  # Test whether the nacked message gets redelivered. In this case, it was not acked when acknowledging the other message
87
86
  message = Timeout.timeout(4) { queue.pop }
88
87
  expect(message.payload).to eq(messages[0].payload)
89
- expect(message.delivery_info.redelivered).to eq(true)
88
+ expect(message.delivery_info.redelivered).to be(true)
90
89
 
91
90
  expect(Receiver).to have_received(:batch).exactly(3).times
92
91
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-21 00:00:00.000000000 Z
11
+ date: 2023-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,20 +44,6 @@ dependencies:
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '3.0'
47
- - !ruby/object:Gem::Dependency
48
- name: bundler
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: '0'
61
47
  description: 'Msgr: Rails-like Messaging Framework'
62
48
  email:
63
49
  - jgraichen@altimos.de
@@ -67,11 +53,11 @@ extensions: []
67
53
  extra_rdoc_files: []
68
54
  files:
69
55
  - ".editorconfig"
70
- - ".github/workflows/build.yml"
71
- - ".github/workflows/lint.yml"
56
+ - ".github/workflows/test.yml"
72
57
  - ".gitignore"
58
+ - ".markdownlint.yml"
73
59
  - ".rubocop.yml"
74
- - ".travis.yml"
60
+ - ".vscode/ltex.dictionary.en-US.txt"
75
61
  - Appraisals
76
62
  - CHANGELOG.md
77
63
  - Gemfile
@@ -82,7 +68,8 @@ files:
82
68
  - gemfiles/rails_5.2.gemfile
83
69
  - gemfiles/rails_6.0.gemfile
84
70
  - gemfiles/rails_6.1.gemfile
85
- - gemfiles/rails_master.gemfile
71
+ - gemfiles/rails_7.0.gemfile
72
+ - gemfiles/rails_head.gemfile
86
73
  - lib/msgr.rb
87
74
  - lib/msgr/binding.rb
88
75
  - lib/msgr/channel.rb
@@ -101,6 +88,7 @@ files:
101
88
  - lib/msgr/test_pool.rb
102
89
  - lib/msgr/version.rb
103
90
  - msgr.gemspec
91
+ - renovate.json
104
92
  - scripts/simple_test.rb
105
93
  - spec/fixtures/msgr_routes_test_1.rb
106
94
  - spec/fixtures/msgr_routes_test_drain.rb
@@ -123,7 +111,6 @@ files:
123
111
  - spec/integration/dummy/config/rabbitmq.yml
124
112
  - spec/integration/dummy/config/routes.rb
125
113
  - spec/integration/dummy/config/secrets.yml
126
- - spec/integration/dummy/db/test.sqlite3
127
114
  - spec/integration/dummy/log/.keep
128
115
  - spec/integration/dummy/public/404.html
129
116
  - spec/integration/dummy/public/422.html
@@ -139,13 +126,15 @@ files:
139
126
  - spec/unit/msgr/dispatcher_spec.rb
140
127
  - spec/unit/msgr/route_spec.rb
141
128
  - spec/unit/msgr/routes_spec.rb
129
+ - spec/unit/msgr/test_pool_spec.rb
142
130
  - spec/unit/msgr_spec.rb
143
131
  - spec/unit/spec_helper.rb
144
132
  - spec/unit/support/.keep
145
133
  homepage: https://github.com/jgraichen/msgr
146
134
  licenses:
147
135
  - MIT
148
- metadata: {}
136
+ metadata:
137
+ rubygems_mfa_required: 'true'
149
138
  post_install_message:
150
139
  rdoc_options: []
151
140
  require_paths:
@@ -154,55 +143,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
143
  requirements:
155
144
  - - ">="
156
145
  - !ruby/object:Gem::Version
157
- version: '0'
146
+ version: '2.7'
158
147
  required_rubygems_version: !ruby/object:Gem::Requirement
159
148
  requirements:
160
149
  - - ">="
161
150
  - !ruby/object:Gem::Version
162
151
  version: '0'
163
152
  requirements: []
164
- rubygems_version: 3.2.4
153
+ rubygems_version: 3.4.18
165
154
  signing_key:
166
155
  specification_version: 4
167
156
  summary: 'Msgr: Rails-like Messaging Framework'
168
- test_files:
169
- - spec/fixtures/msgr_routes_test_1.rb
170
- - spec/fixtures/msgr_routes_test_drain.rb
171
- - spec/integration/dummy/Rakefile
172
- - spec/integration/dummy/app/assets/config/manifest.js
173
- - spec/integration/dummy/app/consumers/application_consumer.rb
174
- - spec/integration/dummy/app/consumers/test_consumer.rb
175
- - spec/integration/dummy/app/controllers/application_controller.rb
176
- - spec/integration/dummy/app/controllers/test_controller.rb
177
- - spec/integration/dummy/app/helpers/application_helper.rb
178
- - spec/integration/dummy/bin/bundle
179
- - spec/integration/dummy/bin/rails
180
- - spec/integration/dummy/bin/rake
181
- - spec/integration/dummy/config.ru
182
- - spec/integration/dummy/config/application.rb
183
- - spec/integration/dummy/config/boot.rb
184
- - spec/integration/dummy/config/database.yml
185
- - spec/integration/dummy/config/environment.rb
186
- - spec/integration/dummy/config/msgr.rb
187
- - spec/integration/dummy/config/rabbitmq.yml
188
- - spec/integration/dummy/config/routes.rb
189
- - spec/integration/dummy/config/secrets.yml
190
- - spec/integration/dummy/db/test.sqlite3
191
- - spec/integration/dummy/log/.keep
192
- - spec/integration/dummy/public/404.html
193
- - spec/integration/dummy/public/422.html
194
- - spec/integration/dummy/public/500.html
195
- - spec/integration/dummy/public/favicon.ico
196
- - spec/integration/msgr/dispatcher_spec.rb
197
- - spec/integration/msgr/railtie_spec.rb
198
- - spec/integration/spec_helper.rb
199
- - spec/integration/test_controller_spec.rb
200
- - spec/unit/msgr/client_spec.rb
201
- - spec/unit/msgr/connection_spec.rb
202
- - spec/unit/msgr/consumer_spec.rb
203
- - spec/unit/msgr/dispatcher_spec.rb
204
- - spec/unit/msgr/route_spec.rb
205
- - spec/unit/msgr/routes_spec.rb
206
- - spec/unit/msgr_spec.rb
207
- - spec/unit/spec_helper.rb
208
- - spec/unit/support/.keep
157
+ test_files: []
@@ -1,52 +0,0 @@
1
- name: Build
2
- on: [push]
3
- jobs:
4
- test:
5
- name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}
6
- runs-on: ubuntu-20.04
7
-
8
- strategy:
9
- matrix:
10
- ruby:
11
- - '2.7'
12
- - '2.6'
13
- - '2.5'
14
- gemfile:
15
- - rails_5.2.gemfile
16
- - rails_6.0.gemfile
17
- - rails_6.1.gemfile
18
- fail-fast: false
19
-
20
- services:
21
- rabbitmq:
22
- image: rabbitmq:latest
23
- options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
24
- ports:
25
- - 5672:5672
26
-
27
- steps:
28
- - uses: actions/checkout@master
29
-
30
- - name: Setup Ruby
31
- uses: ruby/setup-ruby@v1
32
- with:
33
- ruby-version: ${{ matrix.ruby }}
34
- bundler-cache: true
35
- bundler: 1
36
- env:
37
- BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}
38
- BUNDLE_WITHOUT: development
39
- BUNDLE_JOBS: 4
40
- BUNDLE_RETRY: 3
41
-
42
- - name: Run unit tests
43
- env:
44
- AMQP_SERVER: amqp://localhost:5672
45
- BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}
46
- run: bundle exec rspec -Ispec/unit --color spec/unit
47
-
48
- - name: Run integration tests
49
- env:
50
- AMQP_SERVER: amqp://localhost:5672
51
- BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}
52
- run: bundle exec rspec -Ispec/integration --color spec/integration
@@ -1,20 +0,0 @@
1
- name: Lint
2
- on: [push]
3
- jobs:
4
- rubocop:
5
- name: rubocop
6
- runs-on: ubuntu-20.04
7
-
8
- steps:
9
- - uses: actions/checkout@master
10
- - uses: ruby/setup-ruby@v1
11
- with:
12
- ruby-version: 2.6
13
- bundler-cache: true
14
- env:
15
- BUNDLE_WITHOUT: development
16
- BUNDLE_JOBS: 4
17
- BUNDLE_RETRY: 3
18
-
19
- - name: Run rubocop
20
- run: bundle exec rubocop --parallel --color
data/.travis.yml DELETED
@@ -1,29 +0,0 @@
1
- dist: bionic
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.0
6
- - 2.6.5
7
- - 2.5.7
8
- gemfile:
9
- - gemfiles/rails_42.gemfile
10
- - gemfiles/rails_50.gemfile
11
- - gemfiles/rails_51.gemfile
12
- - gemfiles/rails_52.gemfile
13
- - gemfiles/rails_60.gemfile
14
- - gemfiles/rails_master.gemfile
15
- before_install:
16
- - sudo apt-get install -qy rabbitmq-server
17
- - echo yes | rvm gemset delete global
18
- - gem install bundler --version '~> 1.0'
19
- script:
20
- - bundle exec rake spec:unit
21
- - bundle exec rake spec:integration
22
- jobs:
23
- allow_failures:
24
- - gemfile: gemfiles/rails_master.gemfile
25
- exclude:
26
- - rvm: 2.7.0
27
- gemfile: gemfiles/rails_42.gemfile
28
- - rvm: 2.6.5
29
- gemfile: gemfiles/rails_42.gemfile
File without changes