summaryrefslogtreecommitdiff
path: root/scripts/gitaly-test-spawn
diff options
context:
space:
mode:
authorJacob Vosmaer (out of office May 10-14) <jacob@gitlab.com>2018-05-14 08:10:29 +0000
committerRémy Coutable <remy@rymai.me>2018-05-14 08:10:29 +0000
commitd291f69fd9620980aabdd740aa15dfe611aea3fe (patch)
treecc13c2218c29ee2a1e398712d7caaf87c27ab6e8 /scripts/gitaly-test-spawn
parent94ff08ba3d3aa7a1274e3fc919fcb6bf789e09fd (diff)
downloadgitlab-ce-d291f69fd9620980aabdd740aa15dfe611aea3fe.tar.gz
Fix gitaly-ruby bundle poisoning in CI
Diffstat (limited to 'scripts/gitaly-test-spawn')
-rwxr-xr-xscripts/gitaly-test-spawn26
1 files changed, 20 insertions, 6 deletions
diff --git a/scripts/gitaly-test-spawn b/scripts/gitaly-test-spawn
index ecb68c6acc6..e9f91f75650 100755
--- a/scripts/gitaly-test-spawn
+++ b/scripts/gitaly-test-spawn
@@ -1,9 +1,23 @@
#!/usr/bin/env ruby
-gitaly_dir = 'tmp/tests/gitaly'
-env = { 'HOME' => File.expand_path('tmp/tests'),
- 'GEM_PATH' => Gem.path.join(':') }
-args = %W[#{gitaly_dir}/gitaly #{gitaly_dir}/config.toml]
+# This script is used both in CI and in local development 'rspec' runs.
-# Print the PID of the spawned process
-puts spawn(env, *args, [:out, :err] => 'log/gitaly-test.log')
+require_relative 'gitaly_test'
+
+class GitalyTestSpawn
+ include GitalyTest
+
+ def run
+ check_gitaly_config!
+
+ # # Uncomment line below to see all gitaly logs merged into CI trace
+ # spawn('sleep 1; tail -f log/gitaly-test.log')
+
+ pid = start_gitaly
+
+ # In local development this pid file is used by rspec.
+ IO.write(File.expand_path('../tmp/tests/gitaly.pid', __dir__), pid)
+ end
+end
+
+GitalyTestSpawn.new.run