diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2018-07-27 04:18:28 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2018-07-31 23:28:44 +0300 |
commit | 01de2b5df89c4eaca92408c18203050604a4e94f (patch) | |
tree | e5a12c48af108817d8c717fcd04d87cd04d090b8 /spec/support | |
parent | 93c7b6c51a49a1939a876f2510a69e59827ac816 (diff) |
Refactor gitlab:import:repos task to remove direct disk access
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/seed_helper.rb | 6 | ||||
-rw-r--r-- | spec/support/helpers/test_env.rb | 8 | ||||
-rw-r--r-- | spec/support/stored_repositories.rb | 4 |
3 files changed, 8 insertions, 10 deletions
diff --git a/spec/support/helpers/seed_helper.rb b/spec/support/helpers/seed_helper.rb index 8fd107260cc..25781f5e679 100644 --- a/spec/support/helpers/seed_helper.rb +++ b/spec/support/helpers/seed_helper.rb @@ -101,10 +101,4 @@ bla/bla.txt handle.write('# hello'.encode(enc)) end end - - # Prevent developer git configurations from being persisted to test - # repositories - def git_env - { 'GIT_TEMPLATE_DIR' => '' } - end end diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb index e531495d917..8e1d4cfe269 100644 --- a/spec/support/helpers/test_env.rb +++ b/spec/support/helpers/test_env.rb @@ -243,6 +243,14 @@ module TestEnv set_repo_refs(target_repo_path, refs) end + def create_bare_repository(path) + FileUtils.mkdir_p(path) + + system(git_env, *%W(#{Gitlab.config.git.bin_path} -C #{path} init --bare), + out: '/dev/null', + err: '/dev/null') + end + def repos_path @repos_path ||= Gitlab.config.repositories.storages[REPOS_STORAGE].legacy_disk_path end diff --git a/spec/support/stored_repositories.rb b/spec/support/stored_repositories.rb index 21995c89a6e..26f823cb6ef 100644 --- a/spec/support/stored_repositories.rb +++ b/spec/support/stored_repositories.rb @@ -1,8 +1,4 @@ RSpec.configure do |config| - config.before(:each, :repository) do - TestEnv.clean_test_path - end - config.before(:all, :broken_storage) do FileUtils.rm_rf Gitlab.config.repositories.storages.broken.legacy_disk_path end |