Skip to content

Commit 494796a

Browse files
authored
Merge pull request #199 from engineyard/feature/tey-101-write-integration-test-for-deploy-hook-execution
TEY-101: Write integration test for deploy hook execution
2 parents d62bea0 + 799fcfb commit 494796a

File tree

8 files changed

+639
-0
lines changed

8 files changed

+639
-0
lines changed

engineyard-serverside.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
3232
s.add_development_dependency('contracts', '= 0.9')
3333
s.add_development_dependency('aruba', '~> 0.14.14')
3434
s.add_development_dependency('factis', '~> 1.0.1')
35+
s.add_development_dependency('devnull', '~> 0.1.3')
3536

3637
s.required_rubygems_version = %q{>= 1.3.6}
3738
s.test_files = Dir.glob("spec/**/*") + Dir.glob("features/**/*")
Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
Feature: Running A Deploy Hook
2+
In order to inject needed extra steps into the deploy process, I want to be able
3+
to provide hooks for various pre-defined callbacks. Meanwhile, serverside needs
4+
to know how to execute such hooks.
5+
6+
Background:
7+
Given my account name is TestAccount
8+
And my app's name is george
9+
And my app lives in an environment named george_fliggerbop
10+
And the framework env for my environment is staging
11+
12+
Scenario Outline: Running a callback
13+
When I run `engineyard-serverside hook <Callback Name> --app=george --environment-name=george_fliggerbop --account-name=TestAccount --framework-env=staging`
14+
Then I see output indicating that the <Callback Name> hooks were processed
15+
16+
Examples:
17+
| Callback Name |
18+
| before_deploy |
19+
| before_bundle |
20+
| after_bundle |
21+
| before_compile_assets |
22+
| after_compile_assets |
23+
| before_migrate |
24+
| after_migrate |
25+
| before_symlink |
26+
| after_symlink |
27+
| before_restart |
28+
| after_restart |
29+
| after_deploy |
30+
31+
Scenario Outline: Running a callback with no hooks present
32+
Given my app has no deploy hooks
33+
And my app has no service hooks
34+
When I run the <Callback Name> callback
35+
Then I see a notice that the <Callback Name> callback was skipped
36+
37+
Examples:
38+
| Callback Name |
39+
| before_deploy |
40+
| before_bundle |
41+
| after_bundle |
42+
| before_compile_assets |
43+
| after_compile_assets |
44+
| before_migrate |
45+
| after_migrate |
46+
| before_symlink |
47+
| after_symlink |
48+
| before_restart |
49+
| after_restart |
50+
| after_deploy |
51+
52+
Scenario Outline: Running a callback with a Ruby deploy hook
53+
Given my app has a <Callback Name> ruby deploy hook
54+
When I run the <Callback Name> callback
55+
Then the <Callback Name> ruby deploy hook is executed
56+
57+
Examples:
58+
| Callback Name |
59+
| before_deploy |
60+
| before_bundle |
61+
| after_bundle |
62+
| before_compile_assets |
63+
| after_compile_assets |
64+
| before_migrate |
65+
| after_migrate |
66+
| before_symlink |
67+
| after_symlink |
68+
| before_restart |
69+
| after_restart |
70+
| after_deploy |
71+
72+
Scenario Outline: Running a callback with an Executable deploy hook
73+
Given my app has a <Callback Name> executable deploy hook
74+
When I run the <Callback Name> callback
75+
Then the <Callback Name> executable deploy hook is executed
76+
77+
Examples:
78+
| Callback Name |
79+
| before_deploy |
80+
| before_bundle |
81+
| after_bundle |
82+
| before_compile_assets |
83+
| after_compile_assets |
84+
| before_migrate |
85+
| after_migrate |
86+
| before_symlink |
87+
| after_symlink |
88+
| before_restart |
89+
| after_restart |
90+
| after_deploy |
91+
92+
Scenario Outline: Running a callback with both Ruby and Executable deploy hooks
93+
Given my app has a <Callback Name> executable deploy hook
94+
Given my app has a <Callback Name> ruby deploy hook
95+
When I run the <Callback Name> callback
96+
Then the <Callback Name> ruby deploy hook is executed
97+
But the <Callback Name> executable deploy hook is not executed
98+
99+
Examples:
100+
| Callback Name |
101+
| before_deploy |
102+
| before_bundle |
103+
| after_bundle |
104+
| before_compile_assets |
105+
| after_compile_assets |
106+
| before_migrate |
107+
| after_migrate |
108+
| before_symlink |
109+
| after_symlink |
110+
| before_restart |
111+
| after_restart |
112+
| after_deploy |
113+
114+
Scenario Outline: Running a callback with a Ruby service hook
115+
Given I have a service named selective
116+
And my service has a <Callback Name> ruby hook
117+
When I run the <Callback Name> callback
118+
Then the <Callback Name> ruby hook for my service is executed
119+
120+
Examples:
121+
| Callback Name |
122+
| before_deploy |
123+
| before_bundle |
124+
| after_bundle |
125+
| before_compile_assets |
126+
| after_compile_assets |
127+
| before_migrate |
128+
| after_migrate |
129+
| before_symlink |
130+
| after_symlink |
131+
| before_restart |
132+
| after_restart |
133+
| after_deploy |
134+
135+
Scenario Outline: Running a callback with an executable service hook
136+
Given I have a service named selective
137+
And my service has a <Callback Name> executable hook
138+
When I run the <Callback Name> callback
139+
Then the <Callback Name> executable hook for my service is executed
140+
141+
Examples:
142+
| Callback Name |
143+
| before_deploy |
144+
| before_bundle |
145+
| after_bundle |
146+
| before_compile_assets |
147+
| after_compile_assets |
148+
| before_migrate |
149+
| after_migrate |
150+
| before_symlink |
151+
| after_symlink |
152+
| before_restart |
153+
| after_restart |
154+
| after_deploy |
155+
156+
Scenario Outline: Running a callback with both Ruby and Executable service hooks
157+
Given I have a service named selective
158+
Given my service has a <Callback Name> executable hook
159+
Given my service has a <Callback Name> ruby hook
160+
When I run the <Callback Name> callback
161+
Then the <Callback Name> ruby hook for my service is executed
162+
But the <Callback Name> executable hook for my service is not executed
163+
164+
Examples:
165+
| Callback Name |
166+
| before_deploy |
167+
| before_bundle |
168+
| after_bundle |
169+
| before_compile_assets |
170+
| after_compile_assets |
171+
| before_migrate |
172+
| after_migrate |
173+
| before_symlink |
174+
| after_symlink |
175+
| before_restart |
176+
| after_restart |
177+
| after_deploy |
178+
179+
Scenario Outline: Running a callback with botth service hooks and deploy hooks
180+
Given my app has a <Callback Name> executable deploy hook
181+
And I have a service named selective
182+
Given my service has a <Callback Name> ruby hook
183+
When I run the <Callback Name> callback
184+
Then the <Callback Name> ruby hook for my service is executed
185+
And the <Callback Name> executable deploy hook is executed
186+
187+
Examples:
188+
| Callback Name |
189+
| before_deploy |
190+
| before_bundle |
191+
| after_bundle |
192+
| before_compile_assets |
193+
| after_compile_assets |
194+
| before_migrate |
195+
| after_migrate |
196+
| before_symlink |
197+
| after_symlink |
198+
| before_restart |
199+
| after_restart |
200+
| after_deploy |
201+
202+
203+
Scenario Outline: Executable hooks without the executable bit get skipped
204+
Given my app has a <Callback Name> executable deploy hook
205+
But my app's <Callback Name> executable deploy hook is not actually executable
206+
And I have a service named selective
207+
Given my service has a <Callback Name> executable hook
208+
When I run the <Callback Name> callback
209+
Then the <Callback Name> executable hook for my service is executed
210+
But the <Callback Name> executable deploy hook is not executed
211+
212+
Examples:
213+
| Callback Name |
214+
| before_deploy |
215+
| before_bundle |
216+
| after_bundle |
217+
| before_compile_assets |
218+
| after_compile_assets |
219+
| before_migrate |
220+
| after_migrate |
221+
| before_symlink |
222+
| after_symlink |
223+
| before_restart |
224+
| after_restart |
225+
| after_deploy |
226+
227+
@error
228+
Scenario Outline: Ruby hooks with syntax errors cause an error
229+
Given my app has a <Callback Name> ruby deploy hook
230+
And I have a service named selective
231+
And my service has a <Callback Name> ruby hook
232+
But my service's <Callback Name> ruby hook contains syntax errors
233+
When I run the <Callback Name> callback
234+
Then I see a notice about the <Callback Name> syntax error
235+
But my service's <Callback Name> ruby hook is not executed
236+
And the <Callback Name> ruby deploy hook is not executed
237+
238+
Examples:
239+
| Callback Name |
240+
| before_deploy |
241+
| before_bundle |
242+
| after_bundle |
243+
| before_compile_assets |
244+
| after_compile_assets |
245+
| before_migrate |
246+
| after_migrate |
247+
| before_symlink |
248+
| after_symlink |
249+
| before_restart |
250+
| after_restart |
251+
| after_deploy |
252+
253+
@failure
254+
Scenario Outline: Ruby hooks with syntax errors cause an error
255+
Given my app has a <Callback Name> ruby deploy hook
256+
And I have a service named selective
257+
And my service has a <Callback Name> ruby hook
258+
But my service's <Callback Name> ruby hook is prone to errors
259+
When I run the <Callback Name> callback
260+
Then the <Callback Name> ruby hook for my service is executed
261+
But I see a notice about the <Callback Name> exception
262+
And the <Callback Name> ruby deploy hook is not executed
263+
264+
Examples:
265+
| Callback Name |
266+
| before_deploy |
267+
| before_bundle |
268+
| after_bundle |
269+
| before_compile_assets |
270+
| after_compile_assets |
271+
| before_migrate |
272+
| after_migrate |
273+
| before_symlink |
274+
| after_symlink |
275+
| before_restart |
276+
| after_restart |
277+
| after_deploy |

0 commit comments

Comments
 (0)