summaryrefslogtreecommitdiff
path: root/scripts/gitaly-test-spawn
blob: e7e25a217b2811ff45d0229eea4fd582d226ccb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env ruby
# frozen_string_literal: true

# This script is used both in CI and in local development 'rspec' runs.

require_relative '../spec/support/helpers/gitaly_setup'

class GitalyTestSpawn
  include GitalySetup

  def run
    set_bundler_config
    install_gitaly_gems if ENV['CI']
    check_gitaly_config!

    # # Uncomment line below to see all gitaly logs merged into CI trace
    # spawn('sleep 1; tail -f log/gitaly-test.log')

    # In local development this pid file is used by rspec.
    IO.write(File.expand_path('../tmp/tests/gitaly.pid', __dir__), start_gitaly)
    IO.write(File.expand_path('../tmp/tests/gitaly2.pid', __dir__), start_gitaly2)
    IO.write(File.expand_path('../tmp/tests/praefect.pid', __dir__), start_praefect)
  end
end

GitalyTestSpawn.new.run