Commit 0b8e41aa authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of github.com:gitlabhq/gitlabhq

parents 0e9f4320 82536f50
...@@ -22,16 +22,7 @@ module TestEnv ...@@ -22,16 +22,7 @@ module TestEnv
# Disable mailer for spinach tests # Disable mailer for spinach tests
disable_mailer if opts[:mailer] == false disable_mailer if opts[:mailer] == false
# Clean /tmp/tests clean_test_path
tmp_test_path = Rails.root.join('tmp', 'tests')
if File.directory?(tmp_test_path)
Dir.entries(tmp_test_path).each do |entry|
unless ['.', '..', 'gitlab-shell', factory_repo_name].include?(entry)
FileUtils.rm_r(File.join(tmp_test_path, entry))
end
end
end
FileUtils.mkdir_p(repos_path) FileUtils.mkdir_p(repos_path)
...@@ -50,15 +41,30 @@ module TestEnv ...@@ -50,15 +41,30 @@ module TestEnv
allow_any_instance_of(NotificationService).to receive(:mailer).and_call_original allow_any_instance_of(NotificationService).to receive(:mailer).and_call_original
end end
# Clean /tmp/tests
#
# Keeps gitlab-shell and gitlab-test
def clean_test_path
tmp_test_path = Rails.root.join('tmp', 'tests', '**')
Dir[tmp_test_path].each do |entry|
unless File.basename(entry) =~ /\Agitlab-(shell|test)\z/
FileUtils.rm_rf(entry)
end
end
end
def setup_gitlab_shell def setup_gitlab_shell
`rake gitlab:shell:install` unless File.directory?(Rails.root.join(*%w(tmp tests gitlab-shell)))
`rake gitlab:shell:install`
end
end end
def setup_factory_repo def setup_factory_repo
clone_url = "https://gitlab.com/gitlab-org/#{factory_repo_name}.git" clone_url = "https://gitlab.com/gitlab-org/#{factory_repo_name}.git"
unless File.directory?(factory_repo_path) unless File.directory?(factory_repo_path)
system(*%W(git clone #{clone_url} #{factory_repo_path})) system(*%W(git clone -q #{clone_url} #{factory_repo_path}))
end end
Dir.chdir(factory_repo_path) do Dir.chdir(factory_repo_path) do
...@@ -79,7 +85,7 @@ module TestEnv ...@@ -79,7 +85,7 @@ module TestEnv
end end
# We must copy bare repositories because we will push to them. # We must copy bare repositories because we will push to them.
system(*%W(git clone --bare #{factory_repo_path} #{factory_repo_path_bare})) system(*%W(git clone -q --bare #{factory_repo_path} #{factory_repo_path_bare}))
end end
def copy_repo(project) def copy_repo(project)
...@@ -101,7 +107,7 @@ module TestEnv ...@@ -101,7 +107,7 @@ module TestEnv
end end
def factory_repo_path_bare def factory_repo_path_bare
factory_repo_path.to_s + '_bare' "#{factory_repo_path}_bare"
end end
def factory_repo_name def factory_repo_name
......
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