Commit 2e0418ae authored by Rémy Coutable's avatar Rémy Coutable

ci: Introduce a new scripts/setup-test-env script

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 817aa53e
......@@ -154,7 +154,7 @@ setup-test-env:
GITLAB_TEST_EAGER_LOAD: "0"
SETUP_DB: "false"
script:
- run_timed_command "bundle exec ruby -I. -e 'require \"spec/support/helpers/test_env\"; TestEnv.init'"
- run_timed_command "scripts/setup-test-env"
- echo -e "\e[0Ksection_start:`date +%s`:gitaly-test-build[collapsed=true]\r\e[0KCompiling Gitaly binaries"
- run_timed_command "scripts/gitaly-test-build" # Do not use 'bundle exec' here
- echo -e "\e[0Ksection_end:`date +%s`:gitaly-test-build\r\e[0K"
......
# frozen_string_literal: true
require 'omniauth'
require 'omniauth-github'
require 'etc'
require 'active_support/hash_with_indifferent_access'
require_relative '../../lib/gitlab/access'
require_relative '../settings'
require_relative '../object_store_settings'
require_relative '../smime_signature_settings'
......
# frozen_string_literal: true
load File.expand_path('../../../../../lib/tasks/gitlab/helpers.rake', __dir__)
load File.expand_path('../../../../lib/tasks/gitlab/indexer.rake', __dir__)
require_relative '../../../../lib/gitlab/elastic/indexer' unless defined?(Gitlab::Elastic::Indexer)
require_relative '../../../../../lib/gitlab/utils/override'
module EE
module TestEnv
extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
require 'active_support/hash_with_indifferent_access'
module Gitlab
module GitalyClient
# This is a chokepoint that is meant to help us stop remove all places
......
# frozen_string_literal: true
require 'active_support/core_ext/module/delegation'
module Gitlab
module SafeRequestStore
NULL_STORE = Gitlab::NullRequestStore.new
......
# frozen_string_literal: true
require 'rainbow/ext/string'
require_dependency 'gitlab/utils/strong_memoize'
# rubocop:disable Rails/Output
......
# frozen_string_literal: true
require 'active_support/concern'
# Gitlab::VisibilityLevel module
#
# Define allowed public modes that can be used for
......
# frozen_string_literal: true
require_relative '../gitlab/task_helpers'
module SystemCheck
module Helpers
include ::Gitlab::TaskHelpers
......
# frozen_string_literal: true
require_relative '../../system_check/helpers'
# Prevent StateMachine warnings from outputting during a cron task
StateMachines::Machine.ignore_method_conflicts = true if ENV['CRON']
......
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'bundler/setup'
require 'request_store'
require 'rake'
require 'active_support/dependencies'
require 'active_support/dependencies/autoload'
require 'active_support/core_ext/numeric'
require 'active_support/string_inquirer'
module Rails
extend self
def root
Pathname.new(File.expand_path('..', __dir__))
end
def env
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test")
end
end
ActiveSupport::Dependencies.autoload_paths << 'lib'
load File.expand_path('../lib/tasks/gitlab/helpers.rake', __dir__)
load File.expand_path('../lib/tasks/gitlab/gitaly.rake', __dir__)
# Required for config/0_inject_enterprise_edition_module.rb, lib/gitlab/access.rb
require_dependency File.expand_path('../lib/gitlab', __dir__)
require_dependency File.expand_path('../config/initializers/0_inject_enterprise_edition_module', __dir__)
# Require for lib/gitlab/gitaly_client/storage_settings.rb and config/initializers/1_settings.rb
require 'active_support/hash_with_indifferent_access'
# Required for lib/gitlab/visibility_level.rb and lib/gitlab/safe_request_store.rb
require 'active_support/concern'
require 'active_support/core_ext/module/delegation'
# Required for lib/system_check/helpers.rb
require_dependency File.expand_path('../lib/gitlab/task_helpers', __dir__)
# Required for lib/tasks/gitlab/helpers.rake
require_dependency File.expand_path('../lib/system_check/helpers', __dir__)
# Required for config/initializers/1_settings.rb
require 'omniauth'
require 'omniauth-github'
require 'etc'
require_dependency File.expand_path('../lib/gitlab/access', __dir__)
require_dependency File.expand_path('../config/initializers/1_settings', __dir__)
Gitlab.ee do
load File.expand_path('../ee/lib/tasks/gitlab/indexer.rake', __dir__)
require_dependency File.expand_path('../ee/lib/gitlab/elastic/indexer', __dir__)
require_dependency File.expand_path('../lib/gitlab/utils/override', __dir__)
end
require_dependency File.expand_path('../spec/support/helpers/test_env', __dir__)
TestEnv.init
......@@ -2,36 +2,6 @@
require 'parallel'
unless defined?(Rails)
require 'request_store'
require 'rake'
require 'active_support/dependencies'
require 'active_support/core_ext/numeric'
require 'active_support/string_inquirer'
module Rails
extend self
def root
Pathname.new(File.expand_path('../../..', __dir__))
end
def env
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test")
end
end
ActiveSupport::Dependencies.autoload_paths << 'lib'
load File.expand_path('../../../lib/tasks/gitlab/helpers.rake', __dir__)
load File.expand_path('../../../lib/tasks/gitlab/gitaly.rake', __dir__)
# Some files required in the requiring chain of config/initializers/1_settings needs the following.
require_relative '../../../lib/gitlab'
require_relative '../../../config/initializers/0_inject_enterprise_edition_module'
require_relative '../../../config/initializers/1_settings'
end
module TestEnv
extend self
......
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