Commit 62f8555e authored by Toon Claes's avatar Toon Claes

test: Use GitalySetup to build Gitaly in test

To have better control on how `make` is ran to build Gitaly, run it from
the GitalySetup helper module.
parent 8137562c
...@@ -25,9 +25,6 @@ Usage: rake "gitlab:gitaly:install[/installation/dir,/storage/path]") ...@@ -25,9 +25,6 @@ Usage: rake "gitlab:gitaly:install[/installation/dir,/storage/path]")
storage_paths = { 'default' => args.storage_path } storage_paths = { 'default' => args.storage_path }
Gitlab::SetupHelper::Gitaly.create_configuration(args.dir, storage_paths) Gitlab::SetupHelper::Gitaly.create_configuration(args.dir, storage_paths)
# In CI we run scripts/gitaly-test-build
next if ENV['CI'].present?
Dir.chdir(args.dir) do Dir.chdir(args.dir) do
Bundler.with_original_env do Bundler.with_original_env do
env = { "RUBYOPT" => nil, "BUNDLE_GEMFILE" => nil } env = { "RUBYOPT" => nil, "BUNDLE_GEMFILE" => nil }
......
...@@ -12,6 +12,8 @@ require 'logger' ...@@ -12,6 +12,8 @@ require 'logger'
require 'bundler' require 'bundler'
module GitalySetup module GitalySetup
extend self
LOGGER = begin LOGGER = begin
default_name = ENV['CI'] ? 'DEBUG' : 'WARN' default_name = ENV['CI'] ? 'DEBUG' : 'WARN'
level_name = ENV['GITLAB_TESTING_LOG_LEVEL']&.upcase level_name = ENV['GITLAB_TESTING_LOG_LEVEL']&.upcase
......
...@@ -160,9 +160,13 @@ module TestEnv ...@@ -160,9 +160,13 @@ module TestEnv
component_timed_setup('Gitaly', component_timed_setup('Gitaly',
install_dir: gitaly_dir, install_dir: gitaly_dir,
version: Gitlab::GitalyClient.expected_server_version, version: Gitlab::GitalyClient.expected_server_version,
task: "gitlab:gitaly:install", task: "gitlab:gitaly:clone",
fresh_install: ENV.key?('FORCE_GITALY_INSTALL'), fresh_install: ENV.key?('FORCE_GITALY_INSTALL'),
task_args: [gitaly_dir, repos_path, gitaly_url].compact) do task_args: [gitaly_dir, repos_path, gitaly_url].compact) do
unless ci? # In CI we run scripts/gitaly-test-build
GitalySetup.build_gitaly
end
Gitlab::SetupHelper::Gitaly.create_configuration( Gitlab::SetupHelper::Gitaly.create_configuration(
gitaly_dir, gitaly_dir,
{ 'default' => repos_path }, { 'default' => repos_path },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment