X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d2f68bd1e108c3f2dda2322c427050d019b17e04..682dd5b6cc23a455766a7651e3e841257660b31c:/services/api/test/helpers/git_test_helper.rb?ds=sidebyside diff --git a/services/api/test/helpers/git_test_helper.rb b/services/api/test/helpers/git_test_helper.rb index 9abdc4f0d9..6fce321953 100644 --- a/services/api/test/helpers/git_test_helper.rb +++ b/services/api/test/helpers/git_test_helper.rb @@ -14,9 +14,15 @@ require 'tmpdir' module GitTestHelper def self.included base base.setup do - @tmpdir = Dir.mktmpdir() - system("tar", "-xC", @tmpdir, "-f", "test/test.git.tar") + # Extract the test repository data into the default test + # environment's Rails.configuration.git_repositories_dir. (We + # don't use that config setting here, though: it doesn't seem + # worth the risk of stepping on a real git repo root.) + @tmpdir = Rails.root.join 'tmp', 'git' + FileUtils.mkdir_p @tmpdir + system("tar", "-xC", @tmpdir.to_s, "-f", "test/test.git.tar") Rails.configuration.git_repositories_dir = "#{@tmpdir}/test" + intdir = Rails.configuration.git_internal_dir if not File.exist? intdir FileUtils.mkdir_p intdir