diff options
author | Rémy Coutable <remy@rymai.me> | 2018-02-01 12:29:13 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-02-01 13:51:38 +0100 |
commit | c12afad8d9148cf4cc7dd53ff84f4050373b89c2 (patch) | |
tree | 80fa143a2886a0181fc4850d70f9da6a6a7a5bc2 | |
parent | 6de14f8ef5b763e877e83cd341ddfb87f3383422 (diff) | |
download | gitlab-ce-c12afad8d9148cf4cc7dd53ff84f4050373b89c2.tar.gz |
Add debug in scripts/gitaly-test-spawn
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rwxr-xr-x | scripts/gitaly-test-spawn | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/scripts/gitaly-test-spawn b/scripts/gitaly-test-spawn index ecb68c6acc6..54313c7fe87 100755 --- a/scripts/gitaly-test-spawn +++ b/scripts/gitaly-test-spawn @@ -1,9 +1,33 @@ #!/usr/bin/env ruby gitaly_dir = 'tmp/tests/gitaly' -env = { 'HOME' => File.expand_path('tmp/tests'), - 'GEM_PATH' => Gem.path.join(':') } + +puts "Gem.path: #{Gem.path.inspect}" +puts "ENV['BUNDLE_GEMFILE']: #{ENV['BUNDLE_GEMFILE'].inspect}" +puts "ENV['RUBYOPT']: #{ENV['RUBYOPT'].inspect}" + +puts "bundle config in #{Dir.pwd}" +puts `bundle config` + +puts "Reading ../.bundle/config" +puts File.read('../.bundle/config') rescue nil +puts "Reading ~/.bundle/config" +puts File.read(File.expand_path('~/.bundle/config')) rescue 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` +end + +env = { + 'HOME' => File.expand_path('tmp/tests') +} args = %W[#{gitaly_dir}/gitaly #{gitaly_dir}/config.toml] +require 'rubygems' +require 'bundler' + # Print the PID of the spawned process -puts spawn(env, *args, [:out, :err] => 'log/gitaly-test.log') +puts Bundler.with_clean_env { spawn(env, *args, [:out, :err] => 'log/gitaly-test.log') } |