2017-09-10 17:25:29 +05:30
|
|
|
#!/usr/bin/env ruby
|
2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
require 'fileutils'
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
require_relative 'gitaly_test'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
# This script assumes tmp/tests/gitaly already contains the correct
|
|
|
|
# Gitaly version. We just have to compile it and run its 'bundle
|
2018-10-15 14:42:47 +05:30
|
|
|
# install'. We have this separate script for that to avoid bundle
|
|
|
|
# poisoning in CI. This script should only be run in CI.
|
|
|
|
class GitalyTestBuild
|
|
|
|
include GitalyTest
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
def run
|
2021-03-08 18:12:59 +05:30
|
|
|
abort 'gitaly build failed' unless build_gitaly
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
ensure_gitlab_shell_secret!
|
2018-10-15 14:42:47 +05:30
|
|
|
check_gitaly_config!
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
# Starting gitaly further validates its configuration
|
2020-04-22 19:07:51 +05:30
|
|
|
gitaly_pid = start_gitaly
|
2021-02-22 17:27:13 +05:30
|
|
|
gitaly2_pid = start_gitaly2
|
2020-04-22 19:07:51 +05:30
|
|
|
praefect_pid = start_praefect
|
|
|
|
Process.kill('TERM', gitaly_pid)
|
2021-02-22 17:27:13 +05:30
|
|
|
Process.kill('TERM', gitaly2_pid)
|
2020-04-22 19:07:51 +05:30
|
|
|
Process.kill('TERM', praefect_pid)
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
# Make the 'gitaly' executable look newer than 'GITALY_SERVER_VERSION'.
|
|
|
|
# Without this a gitaly executable created in the setup-test-env job
|
|
|
|
# will look stale compared to GITALY_SERVER_VERSION.
|
|
|
|
FileUtils.touch(File.join(tmp_tests_gitaly_dir, 'gitaly'), mtime: Time.now + (1 << 24))
|
2020-04-22 19:07:51 +05:30
|
|
|
FileUtils.touch(File.join(tmp_tests_gitaly_dir, 'praefect'), mtime: Time.now + (1 << 24))
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
GitalyTestBuild.new.run
|