Set an artificial $HOME for gitaly in test

This commit is contained in:
Jacob Vosmaer (GitLab) 2017-11-30 12:58:51 +00:00 committed by Rémy Coutable
parent feece77132
commit a14bd24a02
2 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,8 @@
#!/usr/bin/env ruby
gitaly_dir = 'tmp/tests/gitaly'
env = { 'HOME' => File.expand_path('tmp/tests') }
args = %W[#{gitaly_dir}/gitaly #{gitaly_dir}/config.toml]
# Print the PID of the spawned process
puts spawn(*args, [:out, :err] => 'log/gitaly-test.log')
puts spawn(env, *args, [:out, :err] => 'log/gitaly-test.log')

View File

@ -207,3 +207,6 @@ Shoulda::Matchers.configure do |config|
with.library :rails
end
end
# Prevent Rugged from picking up local developer gitconfig.
Rugged::Settings['search_path_global'] = Rails.root.join('tmp/tests').to_s