summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-02-01 14:15:03 +0100
committerRémy Coutable <remy@rymai.me>2018-02-01 15:59:29 +0100
commit2d9b2772951cc1ae17bc97a446a1550b7f75cca1 (patch)
treec0cb0a376186648cab77da8e3e64babb57af4fc7
parent07265708a4d5020e1eed3a81afd0d663ba86ad8d (diff)
downloadgitlab-ce-2d9b2772951cc1ae17bc97a446a1550b7f75cca1.tar.gz
Testing setting GEM_PATH with Bundler.bundle_path
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rwxr-xr-xscripts/gitaly-test-spawn19
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') }