summaryrefslogtreecommitdiff
path: root/scripts/gitaly-test-build
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-05-17 22:17:20 +0000
committerStan Hu <stanhu@gmail.com>2018-05-17 22:17:20 +0000
commitd3adee5105d4c7745b03ad23999d20fd42b3c575 (patch)
treeb1a67f0dfec96ab4ada3e5363317ce408269e46b /scripts/gitaly-test-build
parentf214efb87bd345490277b9962b43752c095c0b2c (diff)
parentd6c8a55189d62430c7ca4ffa6e5bb63f15a7efc1 (diff)
downloadgitlab-ce-sh-move-delete-groups-api-async.tar.gz
Merge branch 'master' into 'sh-move-delete-groups-api-async'sh-move-delete-groups-api-async
# Conflicts: # lib/api/v3/groups.rb
Diffstat (limited to 'scripts/gitaly-test-build')
-rwxr-xr-xscripts/gitaly-test-build37
1 files changed, 19 insertions, 18 deletions
diff --git a/scripts/gitaly-test-build b/scripts/gitaly-test-build
index b42ae2a2595..374401caf89 100755
--- a/scripts/gitaly-test-build
+++ b/scripts/gitaly-test-build
@@ -2,28 +2,29 @@
require 'fileutils'
+require_relative 'gitaly_test'
+
# 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.
+class GitalyTestBuild
+ include GitalyTest
-tmp_tests_gitaly_dir = File.expand_path('../tmp/tests/gitaly', __dir__)
+ def run
+ abort 'gitaly build failed' unless system(env, 'make', chdir: tmp_tests_gitaly_dir)
-# Use the top-level bundle vendor folder so that we don't reinstall gems twice
-bundle_vendor_path = File.expand_path('../vendor', __dir__)
+ check_gitaly_config!
-env = {
- # This ensure the `clean` config set in `scripts/prepare_build.sh` isn't taken into account
- 'BUNDLE_IGNORE_CONFIG' => 'true',
- 'BUNDLE_GEMFILE' => File.join(tmp_tests_gitaly_dir, 'ruby', 'Gemfile'),
- 'BUNDLE_FLAGS' => "--jobs=4 --path=#{bundle_vendor_path} --retry=3"
-}
+ # Starting gitaly further validates its configuration
+ pid = start_gitaly
+ Process.kill('TERM', pid)
-abort 'gitaly build failed' unless system(env, 'make', chdir: tmp_tests_gitaly_dir)
+ # 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))
+ end
+end
-# 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))
+GitalyTestBuild.new.run