diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-17 18:14:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-17 18:14:29 +0000 |
commit | 55bc011bc0f9e6102732d2694735a546738d6c5f (patch) | |
tree | 62656acd9ebcd542c395639fb0b8c015715777c7 /spec/support/helpers | |
parent | 2a6300a15aa3e96cdcb2d5efc22c00255d246afd (diff) | |
download | gitlab-ce-55bc011bc0f9e6102732d2694735a546738d6c5f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/helpers')
-rw-r--r-- | spec/support/helpers/gitaly_setup.rb | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/spec/support/helpers/gitaly_setup.rb b/spec/support/helpers/gitaly_setup.rb index bf3c67a1818..7db9e0aaf09 100644 --- a/spec/support/helpers/gitaly_setup.rb +++ b/spec/support/helpers/gitaly_setup.rb @@ -10,7 +10,6 @@ require 'securerandom' require 'socket' require 'logger' require 'fileutils' -require 'bundler' require_relative '../../../lib/gitlab/utils' @@ -50,51 +49,18 @@ module GitalySetup expand_path('.gitlab_shell_secret') end - def gemfile - File.join(tmp_tests_gitaly_dir, 'ruby', 'Gemfile') - end - - def gemfile_dir - File.dirname(gemfile) - end - def gitlab_shell_secret_file File.join(tmp_tests_gitlab_shell_dir, '.gitlab_shell_secret') end def env { - 'GEM_PATH' => Gem.path.join(':'), - 'BUNDLER_SETUP' => nil, - 'BUNDLE_INSTALL_FLAGS' => nil, - 'BUNDLE_IGNORE_CONFIG' => '1', - 'BUNDLE_PATH' => bundle_path, - 'BUNDLE_GEMFILE' => gemfile, - 'BUNDLE_JOBS' => '4', - 'BUNDLE_RETRY' => '3', - 'RUBYOPT' => nil, - # Git hooks can't run during tests as the internal API is not running. 'GITALY_TESTING_NO_GIT_HOOKS' => "1", 'GITALY_TESTING_ENABLE_ALL_FEATURE_FLAGS' => "true" } end - def bundle_path - # Allow the user to override BUNDLE_PATH if they need to - return ENV['GITALY_TEST_BUNDLE_PATH'] if ENV['GITALY_TEST_BUNDLE_PATH'] - - if ENV['CI'] - expand_path('vendor/gitaly-ruby') - else - explicit_path = Bundler.configured_bundle_path.explicit_path - - return unless explicit_path - - expand_path(explicit_path) - end - end - def config_path(service) case service when :gitaly @@ -125,10 +91,6 @@ module GitalySetup system(env, *cmd, exception: true, chdir: tmp_tests_gitaly_dir) end - def install_gitaly_gems - run_command(%W[make #{tmp_tests_gitaly_dir}/.ruby-bundle], env: env) - end - def build_gitaly run_command(%w[make all WITH_BUNDLED_GIT=YesPlease], env: env.merge('GIT_VERSION' => nil)) end @@ -188,35 +150,6 @@ module GitalySetup end end - def check_gitaly_config! - LOGGER.debug "Checking gitaly-ruby Gemfile...\n" - - unless File.exist?(gemfile) - message = "#{gemfile} does not exist." - message += "\n\nThis might have happened if the CI artifacts for this build were destroyed." if ENV['CI'] - abort message - end - - LOGGER.debug "Checking gitaly-ruby bundle...\n" - - bundle_install unless bundle_check - - abort 'bundle check failed' unless bundle_check - end - - def bundle_check - bundle_cmd('check') - end - - def bundle_install - bundle_cmd('install') - end - - def bundle_cmd(cmd) - out = ENV['CI'] ? $stdout : '/dev/null' - system(env, 'bundle', cmd, out: out, chdir: gemfile_dir) - end - def connect_proc(toml) # This code needs to work in an environment where we cannot use bundler, # so we cannot easily use the toml-rb gem. This ad-hoc parser should be @@ -358,8 +291,6 @@ module GitalySetup end def spawn_gitaly(toml = nil) - check_gitaly_config! - pids = [] if toml |