Merge branch 'master' into 1971-show-image-thumbnails
[arvados.git] / services / api / test / functional / arvados / v1 / git_setup.rb
1 require 'fileutils'
2 require 'tmpdir'
3
4 # Commit log for test.git.tar
5 # master is the main branch
6 # b1 is a branch off of master
7 # tag1 is a tag
8 #
9 # 1de84a8 * b1
10 # 077ba2a * master
11 # 4fe459a * tag1
12 # 31ce37f * foo
13
14 module GitSetup
15   def setup
16     @tmpdir = Dir.mktmpdir()
17     #puts "setup #{@tmpdir}"
18     `cp test/test.git.tar #{@tmpdir} && cd #{@tmpdir} && tar xf test.git.tar`
19     Rails.configuration.git_repositories_dir = "#{@tmpdir}/test"
20     Commit.refresh_repositories
21   end
22
23   def teardown
24     #puts "teardown #{@tmpdir}"
25     FileUtils.remove_entry @tmpdir, true
26   end
27 end