diff options
author | Rémy Coutable <remy@rymai.me> | 2018-02-01 14:15:03 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-03-05 18:31:00 +0100 |
commit | a2c11d5956cec3ea9b43886e965a14d1c3583fc3 (patch) | |
tree | 749962be14f6a1f75c893fe170a9625df625adab | |
parent | c6d0ca680804d6c058b73ad6e95b2c5526c23ad5 (diff) | |
download | gitlab-ce-gitaly-ruby-isolation-failure-4.tar.gz |
Testing setting GEM_PATH with Bundler.bundle_pathgitaly-ruby-isolation-failure-4
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rwxr-xr-x | scripts/gitaly-test-spawn | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/scripts/gitaly-test-spawn b/scripts/gitaly-test-spawn index 54313c7fe87..96b34faf7d0 100755 --- a/scripts/gitaly-test-spawn +++ b/scripts/gitaly-test-spawn @@ -1,5 +1,8 @@ #!/usr/bin/env ruby +require 'rubygems' +require 'bundler' + gitaly_dir = 'tmp/tests/gitaly' puts "Gem.path: #{Gem.path.inspect}" @@ -14,20 +17,28 @@ puts File.read('../.bundle/config') rescue nil puts "Reading ~/.bundle/config" puts File.read(File.expand_path('~/.bundle/config')) rescue nil +puts "Bundler.bundle_path in #{Dir.pwd}" +puts Bundler.with_clean_env { Bundler.bundle_path } + +bundle_path = nil + Dir.chdir(File.join(gitaly_dir, 'ruby')) do puts "Reading #{File.join(gitaly_dir, 'ruby')}/.bundle/config" puts File.read('.bundle/config') rescue nil puts "bundle config in #{File.join(gitaly_dir, 'ruby')}" puts `bundle config` + + puts "Bundler.bundle_path in #{File.join(gitaly_dir, 'ruby')}" + puts Bundler.with_clean_env { Bundler.bundle_path } + + bundle_path = Bundler.with_clean_env { Bundler.bundle_path } end env = { - 'HOME' => File.expand_path('tmp/tests') + 'HOME' => File.expand_path('tmp/tests'), + 'GEM_PATH' => bundle_path.to_s } args = %W[#{gitaly_dir}/gitaly #{gitaly_dir}/config.toml] -require 'rubygems' -require 'bundler' - # Print the PID of the spawned process puts Bundler.with_clean_env { spawn(env, *args, [:out, :err] => 'log/gitaly-test.log') } |