robot-controller 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de685bf1713c0024ed280fa7e35555af6062efa8
4
- data.tar.gz: 57aa53a3c00e41b09788530c5be01598b4eb44af
3
+ metadata.gz: cc1d7187fe30f51ff0aa1b33b4bc4279842bd897
4
+ data.tar.gz: 19747c392222005ce922fe8dcada9db9e6331261
5
5
  SHA512:
6
- metadata.gz: 4815d7bbdfdf108604454f03b43fedcea8ba9cd29ac2ebe55a051df43254d4bd350d648c1d27c1762373c63c6e18b6d365751466fc75e007eae16bdb290ea2b0
7
- data.tar.gz: a4be372dd98048c84fa21bdcfceace4a2a8cb32d696a4b0b766e72d70f56c3b4fa70c88d92cf204e50db0aa8fe2a7481f30c0e376d5d51b515c2f77af27e8ce9
6
+ metadata.gz: 47458045a08ae1eedbc2c2b06d9b57364b603e66a4f7f54ebf5b74ed5f0c0a08d8aa51cfdfe1873137796c61c38eafcd78f40c06eff677542c5041f9843b472d
7
+ data.tar.gz: b18cfbee4f94539cce0c34886fa242a5d2692b995218467fb4ee2fb88aa60d48f4b042490bbae4b27cd3cc95e93cb911c41813a9cdd610daec3234712dcd0e89
data/.rubocop_todo.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  # This configuration was generated by `rubocop --auto-gen-config`
2
- # on 2015-07-01 12:52:10 -0700 using RuboCop version 0.32.1.
2
+ # on 2015-08-20 12:41:25 -0700 using RuboCop version 0.32.1.
3
3
  # The point is for the user to remove these configuration records
4
4
  # one by one as the offenses are removed from the code base.
5
5
  # Note that changes in the inspected code, or installation of new
@@ -7,7 +7,7 @@
7
7
 
8
8
  # Offense count: 3
9
9
  Metrics/AbcSize:
10
- Max: 87
10
+ Max: 92
11
11
 
12
12
  # Offense count: 1
13
13
  Metrics/BlockNesting:
@@ -15,7 +15,7 @@ Metrics/BlockNesting:
15
15
 
16
16
  # Offense count: 2
17
17
  Metrics/CyclomaticComplexity:
18
- Max: 23
18
+ Max: 24
19
19
 
20
20
  # Offense count: 34
21
21
  # Configuration parameters: AllowURI, URISchemes.
@@ -25,11 +25,11 @@ Metrics/LineLength:
25
25
  # Offense count: 5
26
26
  # Configuration parameters: CountComments.
27
27
  Metrics/MethodLength:
28
- Max: 88
28
+ Max: 89
29
29
 
30
30
  # Offense count: 2
31
31
  Metrics/PerceivedComplexity:
32
- Max: 21
32
+ Max: 22
33
33
 
34
34
  # Offense count: 1
35
35
  # Configuration parameters: Exclude.
data/.travis.yml CHANGED
@@ -1,7 +1,11 @@
1
1
  notifications:
2
2
  email: false
3
3
 
4
+ sudo: false
5
+ cache: bundler
6
+
4
7
  rvm:
5
8
  - 1.9.3
6
9
  - 2.0.0
7
10
  - 2.1.2
11
+ - 2.2.1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.2
1
+ 2.0.3
data/bin/controller CHANGED
@@ -68,7 +68,8 @@ module RobotController
68
68
  running[robot] = 0
69
69
  end
70
70
  RobotController::Parser.load("robots_#{ENV['ROBOT_ENVIRONMENT']}.yml").each do |h|
71
- running[h[:robot]] = h[:n]
71
+ running[h[:robot]] = 0 if running[h[:robot]].nil?
72
+ running[h[:robot]] += h[:n]
72
73
  end
73
74
 
74
75
  # verify that all robots running are known to the config/robots.yml
@@ -15,7 +15,7 @@ module RobotController
15
15
  fail "FileNotFound: #{robots_fn}" unless File.file?(robots_fn)
16
16
 
17
17
  # read the YAML file with the configuration of all the robots to run
18
- robots = YAML.load_file(robots_fn)
18
+ robots = YAML.load_file(robots_fn)
19
19
 
20
20
  # determine current host if not provided
21
21
  host ||= `hostname -s`.strip
@@ -0,0 +1,4 @@
1
+ host1:
2
+ - X
3
+ - X:A,B,C:1
4
+ - X:D:3
@@ -52,6 +52,20 @@ describe RobotController::Parser do
52
52
  end
53
53
  end
54
54
 
55
+ context 'multi' do
56
+ subject do
57
+ RobotController::Parser.load('multi.yml', 'spec/fixtures', 'host1')
58
+ end
59
+
60
+ it 'parses correctly' do
61
+ expect(subject).to eq [
62
+ { robot: 'X', queues: %w(X_default), n: 1 },
63
+ { robot: 'X', queues: %w(X_A X_B X_C), n: 1 },
64
+ { robot: 'X', queues: %w(X_D), n: 3 }
65
+ ]
66
+ end
67
+ end
68
+
55
69
  context 'file-not-found' do
56
70
  it 'reports error' do
57
71
  expect do
@@ -158,4 +158,22 @@ describe RobotController::Verify do
158
158
  )
159
159
  end
160
160
  end
161
+
162
+ context 'verify method with multiple robot queues' do
163
+ subject do
164
+ RobotController::Verify.new('dor_gisAssemblyWF_assign-placenames' => 3)
165
+ end
166
+
167
+ it 'runs controller status for up' do
168
+ allow(subject).to receive(:controller_status).and_return([
169
+ 'robot01_01_dor_gisAssemblyWF_assign-placenames(pid:29483): up',
170
+ 'robot02_01_dor_gisAssemblyWF_foobar(pid:29485): up',
171
+ 'robot03_01_dor_gisAssemblyWF_assign-placenames(pid:29484): up',
172
+ 'robot04_01_dor_gisAssemblyWF_assign-placenames(pid:29486): up'
173
+ ])
174
+ expect(subject.verify).to eq(
175
+ 'dor_gisAssemblyWF_assign-placenames' => { state: :up, running: 3 }
176
+ )
177
+ end
178
+ end
161
179
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robot-controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Hardy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-07 00:00:00.000000000 Z
11
+ date: 2015-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bluepill
@@ -28,140 +28,140 @@ dependencies:
28
28
  name: resque
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.25.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.25.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: whenever
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.9.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.9.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: redcarpet
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: version_bumper
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: yard
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  description:
@@ -172,11 +172,11 @@ executables:
172
172
  extensions: []
173
173
  extra_rdoc_files: []
174
174
  files:
175
- - .gitignore
176
- - .rspec
177
- - .rubocop.yml
178
- - .rubocop_todo.yml
179
- - .travis.yml
175
+ - ".gitignore"
176
+ - ".rspec"
177
+ - ".rubocop.yml"
178
+ - ".rubocop_todo.yml"
179
+ - ".travis.yml"
180
180
  - Gemfile
181
181
  - LICENSE
182
182
  - README.md
@@ -198,6 +198,7 @@ files:
198
198
  - lib/tasks/yard.rake
199
199
  - robot-controller.gemspec
200
200
  - spec/fixtures/matcher.yml
201
+ - spec/fixtures/multi.yml
201
202
  - spec/fixtures/standard.yml
202
203
  - spec/spec_helper.rb
203
204
  - spec/unit/robots_spec.rb
@@ -213,23 +214,24 @@ require_paths:
213
214
  - lib
214
215
  required_ruby_version: !ruby/object:Gem::Requirement
215
216
  requirements:
216
- - - '>='
217
+ - - ">="
217
218
  - !ruby/object:Gem::Version
218
219
  version: '0'
219
220
  required_rubygems_version: !ruby/object:Gem::Requirement
220
221
  requirements:
221
- - - '>='
222
+ - - ">="
222
223
  - !ruby/object:Gem::Version
223
224
  version: 1.3.6
224
225
  requirements: []
225
226
  rubyforge_project:
226
- rubygems_version: 2.4.5
227
+ rubygems_version: 2.4.6
227
228
  signing_key:
228
229
  specification_version: 4
229
230
  summary: Monitors and controls running workflow robots off of priority queues and
230
231
  within a cluster
231
232
  test_files:
232
233
  - spec/fixtures/matcher.yml
234
+ - spec/fixtures/multi.yml
233
235
  - spec/fixtures/standard.yml
234
236
  - spec/spec_helper.rb
235
237
  - spec/unit/robots_spec.rb