diff options
author | Elan Ruusamäe <glen@delfi.ee> | 2016-11-20 16:30:45 +0200 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-12-01 11:41:03 +0000 |
commit | 24d6df6c882c4224d66271f81cc04c5a9ba3b3f5 (patch) | |
tree | a0b288a8f98f49f6c44a0c36c1e763f1968f4d02 | |
parent | a04895942167e65dcc39bf2d9b6557b28f1e5573 (diff) | |
download | gitlab-shell-24d6df6c882c4224d66271f81cc04c5a9ba3b3f5.tar.gz |
spec/custom_hook: ensure "before" does complete cleanup
this fixes problem that tests succeeded locally but failed in ci
where parent dirs were missing
-rw-r--r-- | spec/gitlab_custom_hook_spec.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/gitlab_custom_hook_spec.rb b/spec/gitlab_custom_hook_spec.rb index 05ec38b..faa4f2b 100644 --- a/spec/gitlab_custom_hook_spec.rb +++ b/spec/gitlab_custom_hook_spec.rb @@ -47,9 +47,7 @@ describe GitlabCustomHook do end def cleanup_hook_setup - FileUtils.rm_rf(File.join(tmp_repo_path, 'custom_hooks')) - 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_repo_path)) FileUtils.rm_rf(File.join(tmp_root_path, 'hooks')) end @@ -66,16 +64,17 @@ describe GitlabCustomHook do before do 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', 'update.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.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 after do |