Commit 24d6df6c authored by Elan Ruusamäe's avatar Elan Ruusamäe Committed by Sean McGivern

spec/custom_hook: ensure "before" does complete cleanup

this fixes problem that tests succeeded locally but failed in ci
where parent dirs were missing
parent a0489594
...@@ -47,9 +47,7 @@ describe GitlabCustomHook do ...@@ -47,9 +47,7 @@ describe GitlabCustomHook do
end end
def cleanup_hook_setup def cleanup_hook_setup
FileUtils.rm_rf(File.join(tmp_repo_path, 'custom_hooks')) FileUtils.rm_rf(File.join(tmp_repo_path))
FileUtils.rm_rf(File.join(tmp_repo_path, 'hooks'))
FileUtils.rm_rf(File.join(tmp_repo_path, 'hooks.d'))
FileUtils.rm_rf(File.join(tmp_root_path, 'hooks')) FileUtils.rm_rf(File.join(tmp_root_path, 'hooks'))
end end
...@@ -66,16 +64,17 @@ describe GitlabCustomHook do ...@@ -66,16 +64,17 @@ describe GitlabCustomHook do
before do before do
cleanup_hook_setup cleanup_hook_setup
FileUtils.mkdir_p(File.join(tmp_repo_path, 'custom_hooks'))
FileUtils.mkdir_p(File.join(tmp_repo_path, 'custom_hooks', 'update.d'))
FileUtils.mkdir_p(File.join(tmp_repo_path, 'custom_hooks', 'pre-receive.d'))
FileUtils.mkdir_p(File.join(tmp_repo_path, 'custom_hooks', 'post-receive.d'))
FileUtils.mkdir_p(File.join(tmp_root_path, 'hooks')) FileUtils.mkdir_p(File.join(tmp_root_path, 'hooks'))
FileUtils.mkdir_p(File.join(tmp_root_path, 'hooks', 'update.d')) FileUtils.mkdir_p(File.join(tmp_root_path, 'hooks', 'update.d'))
FileUtils.mkdir_p(File.join(tmp_root_path, 'hooks', 'pre-receive.d')) FileUtils.mkdir_p(File.join(tmp_root_path, 'hooks', 'pre-receive.d'))
FileUtils.mkdir_p(File.join(tmp_root_path, 'hooks', 'post-receive.d')) FileUtils.mkdir_p(File.join(tmp_root_path, 'hooks', 'post-receive.d'))
FileUtils.symlink(File.join(tmp_root_path, 'hooks'), File.join(tmp_repo_path, 'hooks')) FileUtils.symlink(File.join(tmp_root_path, 'hooks'), File.join(tmp_repo_path, 'hooks'))
FileUtils.mkdir_p(File.join(tmp_repo_path, 'custom_hooks'))
FileUtils.mkdir_p(File.join(tmp_repo_path, 'custom_hooks', 'update.d'))
FileUtils.mkdir_p(File.join(tmp_repo_path, 'custom_hooks', 'pre-receive.d'))
FileUtils.mkdir_p(File.join(tmp_repo_path, 'custom_hooks', 'post-receive.d'))
end end
after do after do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment