Commit bc77c387 authored by Rémy Coutable's avatar Rémy Coutable

Rename GitalyTest to GitalySetup and move it to the 'spec' folder

This makes sure unit and integration tests run when this file is
touched.
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 1fd9a02c
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
require 'fileutils' require 'fileutils'
require_relative 'gitaly_test' require_relative '../spec/support/helpers/gitaly_setup'
# This script assumes tmp/tests/gitaly already contains the correct # This script assumes tmp/tests/gitaly already contains the correct
# Gitaly version. We just have to compile it and run its 'bundle # Gitaly version. We just have to compile it and run its 'bundle
# install'. We have this separate script for that to avoid bundle # install'. We have this separate script for that to avoid bundle
# poisoning in CI. This script should only be run in CI. # poisoning in CI. This script should only be run in CI.
class GitalyTestBuild class GitalyTestBuild
include GitalyTest include GitalySetup
def run def run
set_bundler_config set_bundler_config
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
# This script is used both in CI and in local development 'rspec' runs. # This script is used both in CI and in local development 'rspec' runs.
require_relative 'gitaly_test' require_relative '../spec/support/helpers/gitaly_setup'
class GitalyTestSpawn class GitalyTestSpawn
include GitalyTest include GitalySetup
def run def run
set_bundler_config set_bundler_config
......
...@@ -10,7 +10,7 @@ require 'securerandom' ...@@ -10,7 +10,7 @@ require 'securerandom'
require 'socket' require 'socket'
require 'logger' require 'logger'
module GitalyTest module GitalySetup
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
...@@ -19,15 +19,15 @@ module GitalyTest ...@@ -19,15 +19,15 @@ module GitalyTest
end end
def tmp_tests_gitaly_dir def tmp_tests_gitaly_dir
File.expand_path('../tmp/tests/gitaly', __dir__) File.expand_path('../../../tmp/tests/gitaly', __dir__)
end end
def tmp_tests_gitlab_shell_dir def tmp_tests_gitlab_shell_dir
File.expand_path('../tmp/tests/gitlab-shell', __dir__) File.expand_path('../../../tmp/tests/gitlab-shell', __dir__)
end end
def rails_gitlab_shell_secret def rails_gitlab_shell_secret
File.expand_path('../.gitlab_shell_secret', __dir__) File.expand_path('../../../.gitlab_shell_secret', __dir__)
end end
def gemfile def gemfile
...@@ -62,7 +62,7 @@ module GitalyTest ...@@ -62,7 +62,7 @@ module GitalyTest
system('bundle config set --local retry 3', chdir: gemfile_dir) system('bundle config set --local retry 3', chdir: gemfile_dir)
if ENV['CI'] if ENV['CI']
bundle_path = File.expand_path('../vendor/gitaly-ruby', __dir__) bundle_path = File.expand_path('../../../vendor/gitaly-ruby', __dir__)
system('bundle', 'config', 'set', '--local', 'path', bundle_path, chdir: gemfile_dir) system('bundle', 'config', 'set', '--local', 'path', bundle_path, chdir: gemfile_dir)
end end
end end
......
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