masamune 0.18.3 → 0.18.4
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74acb711585f7828067e24f3598a32ea3a60e9d9
|
4
|
+
data.tar.gz: a65eb2509f2b91f10b2819c64603496d41bde2d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1be2f3708efa65705e0ff2745027d564f9e8035b034764c062e04d19fb089ffc03d7383104fa7b3773fa658d8d11f237ef18694243d941a6f74ec3491467c50
|
7
|
+
data.tar.gz: fd906239e801f5b6f72b675f93e6ff48bcb004827f2f14da6be7be870d8f5fed4bfd177c5c28629e4f14a41b95bb67655d3d7e254b709bd4f69e3e8b340419b2
|
@@ -26,9 +26,16 @@ module Masamune::Actions
|
|
26
26
|
opts = opts.to_hash.symbolize_keys
|
27
27
|
|
28
28
|
command = Masamune::Commands::PostgresAdmin.new(environment, opts)
|
29
|
+
command = Masamune::Commands::RetryWithBackoff.new(command, postgres_admin_retry_with_backoff_options.merge(opts))
|
29
30
|
command = Masamune::Commands::Shell.new(command, opts)
|
30
31
|
|
31
32
|
command.execute
|
32
33
|
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def postgres_admin_retry_with_backoff_options
|
38
|
+
configuration.commands.postgres.merge(configuration.commands.postgres_admin).slice(:retries, :backoff)
|
39
|
+
end
|
33
40
|
end
|
34
41
|
end
|
data/lib/masamune/version.rb
CHANGED
@@ -30,6 +30,28 @@ describe Masamune::Actions::PostgresAdmin do
|
|
30
30
|
|
31
31
|
let(:instance) { klass.new }
|
32
32
|
|
33
|
+
shared_context 'retries and backoff' do
|
34
|
+
context 'with retries and backoff configured via postgres_admin command' do
|
35
|
+
before do
|
36
|
+
allow(instance).to receive_message_chain(:configuration, :commands, :postgres).and_return(retries: 1, backoff: 10)
|
37
|
+
allow(instance).to receive_message_chain(:configuration, :commands, :postgres_admin).and_return(retries: 3, backoff: 1)
|
38
|
+
expect(Masamune::Commands::RetryWithBackoff).to receive(:new).with(anything, hash_including(retries: 3, backoff: 1)).once.and_call_original
|
39
|
+
end
|
40
|
+
|
41
|
+
it { is_expected.to be_success }
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'with retries and backoff configured via postgres command' do
|
45
|
+
before do
|
46
|
+
allow(instance).to receive_message_chain(:configuration, :commands, :postgres).and_return(retries: 1, backoff: 10)
|
47
|
+
allow(instance).to receive_message_chain(:configuration, :commands, :postgres_admin).and_return({})
|
48
|
+
expect(Masamune::Commands::RetryWithBackoff).to receive(:new).with(anything, hash_including(retries: 1, backoff: 10)).once.and_call_original
|
49
|
+
end
|
50
|
+
|
51
|
+
it { is_expected.to be_success }
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
33
55
|
describe '.postgres_admin' do
|
34
56
|
subject { instance.postgres_admin(action: action, database: 'zombo') }
|
35
57
|
|
@@ -41,6 +63,8 @@ describe Masamune::Actions::PostgresAdmin do
|
|
41
63
|
end
|
42
64
|
|
43
65
|
it { is_expected.to be_success }
|
66
|
+
|
67
|
+
include_context 'retries and backoff'
|
44
68
|
end
|
45
69
|
|
46
70
|
context 'with :action :drop' do
|
@@ -51,6 +75,8 @@ describe Masamune::Actions::PostgresAdmin do
|
|
51
75
|
end
|
52
76
|
|
53
77
|
it { is_expected.to be_success }
|
78
|
+
|
79
|
+
include_context 'retries and backoff'
|
54
80
|
end
|
55
81
|
end
|
56
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: masamune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Andrews
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|