diff options
author | Nick Thomas <nick@gitlab.com> | 2019-05-16 16:49:26 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-05-16 16:49:26 +0100 |
commit | d2425716aa9f084d68fecae74688a3f6dac24ce2 (patch) | |
tree | 80dd891a04bd192af3058bfc5e930aaa15a2bee6 /spec | |
parent | 112193e8a6dea1a42e234e06244b1a20dd7d711b (diff) | |
download | gitlab-ce-d2425716aa9f084d68fecae74688a3f6dac24ce2.tar.gz |
CE backport for "Use gitlab-elasticsearch-indexer in tests"ce-6481-use-elasticsearch-indexer-in-specs
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/helpers/test_env.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb index dc902d373b8..06b5ecdf150 100644 --- a/spec/support/helpers/test_env.rb +++ b/spec/support/helpers/test_env.rb @@ -135,7 +135,7 @@ module TestEnv def clean_gitlab_test_path Dir[TMP_TEST_PATH].each do |entry| - if File.basename(entry) =~ /\A(gitlab-(test|test_bare|test-fork|test-fork_bare))\z/ + unless test_dirs.include?(File.basename(entry)) FileUtils.rm_rf(entry) end end @@ -312,6 +312,18 @@ module TestEnv private + # These are directories that should be preserved at cleanup time + def test_dirs + @test_dirs ||= %w[ + gitaly + gitlab-shell + gitlab-test + gitlab-test_bare + gitlab-test-fork + gitlab-test-fork_bare + ] + end + def factory_repo_path @factory_repo_path ||= Rails.root.join('tmp', 'tests', factory_repo_name) end |