diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2018-05-08 19:13:38 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2018-05-08 19:13:38 +0300 |
commit | 14bc26436573120946ef3f55990c9a411575a0df (patch) | |
tree | 8e9dd42f86a4cbdcbc0549cf5c71342a7f52b5c5 | |
parent | a162eb3d98d5399b137165248c38dca476aec8ba (diff) |
Add comments
-rwxr-xr-x | scripts/gitaly-test-build | 14 | ||||
-rw-r--r-- | scripts/gitaly-test-env.rb | 7 | ||||
-rwxr-xr-x | scripts/gitaly-test-spawn | 10 |
3 files changed, 14 insertions, 17 deletions
diff --git a/scripts/gitaly-test-build b/scripts/gitaly-test-build index c8b91c7b4e4..d554879a72f 100755 --- a/scripts/gitaly-test-build +++ b/scripts/gitaly-test-build @@ -7,21 +7,11 @@ include GitalyTest # This script assumes tmp/tests/gitaly already contains the correct # Gitaly version. We just have to compile it and run its 'bundle -# install'. We have this separate script for that because weird things -# were happening in CI when we have a 'bundle exec' process that later -# called 'bundle install' using a different Gemfile, as happens with -# gitlab-ce and gitaly. +# install'. We have this separate script for that to avoid bundle +# poisoning in CI. This script should only be run in CI. abort 'gitaly build failed' unless system(env, 'make', chdir: tmp_tests_gitaly_dir) -puts 'gitlab-ce path to gitaly-proto:' -system('bundle', 'show', 'gitaly-proto') - -# Bundle config sanity check, for visual inspection in case of problems. -system(env, 'bundle', 'config', chdir: File.dirname(gemfile)) - -abort 'bundle list failed' unless system(env, 'bundle', 'list', chdir: File.dirname(gemfile)) - check_gitaly_config! # Make the 'gitaly' executable look newer than 'GITALY_SERVER_VERSION'. diff --git a/scripts/gitaly-test-env.rb b/scripts/gitaly-test-env.rb index a84c4bc4e4f..40956798b61 100644 --- a/scripts/gitaly-test-env.rb +++ b/scripts/gitaly-test-env.rb @@ -1,3 +1,9 @@ +# This file contains environment settings for gitaly when it's running +# as part of the gitlab-ce/ee test suite. +# +# Please be careful when modifying this file. Your changes must work +# both for local development rspec runs, and in CI. + module GitalyTest def tmp_tests_gitaly_dir File.expand_path('../tmp/tests/gitaly', __dir__) @@ -29,6 +35,7 @@ module GitalyTest end def check_gitaly_config! + puts 'Checking gitaly-ruby bundle...' abort 'bundle check failed' unless system(env, 'bundle', 'check', chdir: File.dirname(gemfile)) abort 'config load failed' unless system(env, args[0], '-test-config', *args[1, args.length]) diff --git a/scripts/gitaly-test-spawn b/scripts/gitaly-test-spawn index fb9a004f57c..53303749b7e 100755 --- a/scripts/gitaly-test-spawn +++ b/scripts/gitaly-test-spawn @@ -1,16 +1,16 @@ #!/usr/bin/env ruby +# This script is used both in CI and in local development 'rspec' runs. + require_relative 'gitaly-test-env' include GitalyTest -# For CI debugging purposes -system(env, 'bundle', 'config', chdir: File.dirname(gemfile)) - check_gitaly_config! -# # Uncomment to see all gitaly logs in CI +# # Uncomment line below to see all gitaly logs merged into CI trace # spawn('sleep 1; tail -f log/gitaly-test.log') -# Print the PID of the spawned process. This value is used by rspec. pid = spawn(env, *args, [:out, :err] => 'log/gitaly-test.log') + +# In local development rspec runs this pid file is used by rspec. IO.write(File.expand_path('../tmp/tests/gitaly.pid', __dir__), pid) |