gitlab-org--gitlab-foss/scripts/gitaly-test-build

35 lines
1.1 KiB
Plaintext
Raw Normal View History

2017-07-31 13:17:14 +00:00
#!/usr/bin/env ruby
require 'fileutils'
2018-05-14 08:10:29 +00:00
require_relative 'gitaly_test'
2017-07-31 13:17:14 +00:00
# This script assumes tmp/tests/gitaly already contains the correct
# Gitaly version. We just have to compile it and run its 'bundle
2018-05-14 08:10:29 +00:00
# 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-07-31 13:17:14 +00:00
2018-05-14 08:10:29 +00:00
def run
abort 'gitaly build failed' unless system(env, 'make', chdir: tmp_tests_gitaly_dir)
ensure_gitlab_shell_secret!
2018-05-14 08:10:29 +00:00
check_gitaly_config!
2018-05-14 08:10:29 +00:00
# Starting gitaly further validates its configuration
gitaly_pid = start_gitaly
praefect_pid = start_praefect
Process.kill('TERM', gitaly_pid)
Process.kill('TERM', praefect_pid)
2018-05-14 08:10:29 +00:00
# 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))
FileUtils.touch(File.join(tmp_tests_gitaly_dir, 'praefect'), mtime: Time.now + (1 << 24))
2018-05-14 08:10:29 +00:00
end
end
2018-05-14 08:10:29 +00:00
GitalyTestBuild.new.run