cumuli 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Rakefile +6 -0
- data/cumuli.gemspec +1 -0
- data/features/fixtures/test.log +0 -0
- data/features/graceful_exit.feature +14 -0
- data/features/step_definitions/app_steps.rb +32 -0
- data/features/support/env.rb +13 -0
- data/features/support/io_capture.rb +11 -0
- data/lib/cumuli/app/foreman_process.rb +8 -1
- data/lib/cumuli/ps.rb +12 -3
- data/lib/cumuli/version.rb +1 -1
- data/spec/support/mock_apps.rb +0 -4
- metadata +26 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01547cb2adf31baf7fd1328f3a7807bfd08aed43
|
4
|
+
data.tar.gz: ced1f7b479d52b9a86b9cdb25163ab3a146587ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31f12a1ccf7d92442cee54661035eb3e202bcabd8e85fdac9244268a2fb343ec17b7da5fc3f82f7ce4e2caa1f57f066580301246b622043d749b6b105b358dca
|
7
|
+
data.tar.gz: 0648447b4050095bcea6c3296b4c46974051e2f5d13b4eaac6e98a0493c3b6728d3ad48b9252768ecdad6047c1166490b1fb8b424a8842e688e10e0bdb0fe4ae
|
data/.gitignore
CHANGED
data/Rakefile
CHANGED
data/cumuli.gemspec
CHANGED
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Feature: Cumuli exits the app gracefully
|
2
|
+
In order to use Cumuli to test in an integration way, a suite of apps and services
|
3
|
+
As a developer with a SOA stack
|
4
|
+
I want cucumber to exit with a good success code
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given the app suite is loaded
|
8
|
+
|
9
|
+
Scenario: App is stopped in a cucumber step
|
10
|
+
When I shutdown the app suite
|
11
|
+
Then the processes should not be running
|
12
|
+
And I should see that the rake was not aborted
|
13
|
+
|
14
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
Given(/^the app suite is loaded$/) do
|
2
|
+
@app = Cumuli::App.new({
|
3
|
+
env: 'test',
|
4
|
+
wait_time: 5,
|
5
|
+
log_dir: File.dirname(__FILE__) + "/../../spec/fixtures/log",
|
6
|
+
app_dir: File.dirname(__FILE__) + "/../../spec/fixtures/app_set"
|
7
|
+
})
|
8
|
+
@app.start
|
9
|
+
@pid = @app.pid
|
10
|
+
end
|
11
|
+
|
12
|
+
When(/^I shutdown the app suite$/) do
|
13
|
+
@trapped = false
|
14
|
+
|
15
|
+
trap('INT') do
|
16
|
+
@trapped = true
|
17
|
+
end
|
18
|
+
|
19
|
+
@app.stop
|
20
|
+
end
|
21
|
+
|
22
|
+
Then(/^I should see that the rake was not aborted$/) do
|
23
|
+
@trapped.should == false
|
24
|
+
end
|
25
|
+
|
26
|
+
Then(/^the processes should not be running$/) do
|
27
|
+
Cumuli::Waiter.new.wait_until(3) do
|
28
|
+
pses = Cumuli::PS.new.children(@pid)
|
29
|
+
pses.nil?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -45,10 +45,17 @@ module Cumuli
|
|
45
45
|
|
46
46
|
def stop
|
47
47
|
return if @killed_it
|
48
|
-
|
48
|
+
kill_children
|
49
49
|
@killed_it = true
|
50
50
|
@pid = nil
|
51
51
|
end
|
52
|
+
|
53
|
+
def kill_children
|
54
|
+
pids = PS.new.tree(pid)
|
55
|
+
pids.reverse.each do |p|
|
56
|
+
Process.kill("KILL", p)
|
57
|
+
end
|
58
|
+
end
|
52
59
|
end
|
53
60
|
end
|
54
61
|
end
|
data/lib/cumuli/ps.rb
CHANGED
@@ -45,9 +45,18 @@ module Cumuli
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def tree(pid)
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
collection = []
|
49
|
+
if kids = children(pid)
|
50
|
+
collection += kids
|
51
|
+
kids.each do |k|
|
52
|
+
collection += tree(k)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
collection
|
56
|
+
end
|
57
|
+
|
58
|
+
def children(pid)
|
59
|
+
ppid_hash[pid]
|
51
60
|
end
|
52
61
|
|
53
62
|
def report(pid)
|
data/lib/cumuli/version.rb
CHANGED
data/spec/support/mock_apps.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cumuli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SocialChorus
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-07-
|
15
|
+
date: 2013-07-18 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: foreman
|
@@ -70,6 +70,20 @@ dependencies:
|
|
70
70
|
- - '>='
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: cucumber
|
75
|
+
requirement: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
type: :development
|
81
|
+
prerelease: false
|
82
|
+
version_requirements: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
73
87
|
description: Cumuli runs several foreman processes in different directories
|
74
88
|
email:
|
75
89
|
- developers@socialchorus.com
|
@@ -87,6 +101,11 @@ files:
|
|
87
101
|
- Rakefile
|
88
102
|
- bin/cumuli
|
89
103
|
- cumuli.gemspec
|
104
|
+
- features/fixtures/test.log
|
105
|
+
- features/graceful_exit.feature
|
106
|
+
- features/step_definitions/app_steps.rb
|
107
|
+
- features/support/env.rb
|
108
|
+
- features/support/io_capture.rb
|
90
109
|
- lib/cumuli.rb
|
91
110
|
- lib/cumuli/app.rb
|
92
111
|
- lib/cumuli/app/app.rb
|
@@ -148,6 +167,11 @@ signing_key:
|
|
148
167
|
specification_version: 4
|
149
168
|
summary: Cumuli makes SOA on Heroku easier by delegating to Foreman in a Procfile
|
150
169
|
test_files:
|
170
|
+
- features/fixtures/test.log
|
171
|
+
- features/graceful_exit.feature
|
172
|
+
- features/step_definitions/app_steps.rb
|
173
|
+
- features/support/env.rb
|
174
|
+
- features/support/io_capture.rb
|
151
175
|
- spec/app/app_spec.rb
|
152
176
|
- spec/app/procs_spec.rb
|
153
177
|
- spec/cli/args_spec.rb
|