Skip to content

Commit 5a2e3e2

Browse files
committed
Executable hooks must actually be executable
1 parent c39f071 commit 5a2e3e2

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

features/hook/running-a-deploy-hook.feature

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,37 @@ Feature: Running A Deploy Hook
198198
| before_restart |
199199
| after_restart |
200200
| after_deploy |
201-
#Scenario: Running a callback with both service hooks and deploy hooks
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 |
202226

203227
#@failure
204228
#Scenario: Ruby hooks with syntax errors cause an error
205229

230+
#@failure
231+
#Scenario: Ruby hook errors cause an error
232+
206233
#@failure
207234
#Scenario: Executable hooks that are not actually executable cause an error

features/hook/step_definitions/running-a-deploy-hook-steps.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ def service_name
140140
to eql(false)
141141
end
142142

143+
Given %r{^my app's (.+) executable deploy hook is not actually executable$} do |callback_name|
144+
hook = deploy_hooks_path.join(callback_name)
145+
146+
hook.chmod(0644)
147+
end
148+
143149
Then %{I see the output} do
144150
puts "OUTPUT START\n\n#{output_text}\n\nOUTPUT END"
145151
end

0 commit comments

Comments
 (0)