Commit 6bf05c3a authored by Jan Provaznik's avatar Jan Provaznik

Merge branch...

Merge branch '327608-consider-running-all-tests-when-scripts-gitaly_test-rb-is-changed' into 'master'

Ensure unit and integration tests run for any change to our central Gitaly test setup file [RUN ALL RSPEC]

See merge request gitlab-org/gitlab!59288
parents 61e691e4 bc77c387
...@@ -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