2015-11-25 16:18:44 +00:00
|
|
|
Rails.application.configure do
|
2017-03-10 02:28:20 +00:00
|
|
|
# Make sure the middleware is inserted first in middleware chain
|
2018-06-13 03:12:38 +00:00
|
|
|
config.middleware.insert_before(ActionDispatch::Static, Gitlab::Testing::RequestBlockerMiddleware)
|
|
|
|
config.middleware.insert_before(ActionDispatch::Static, Gitlab::Testing::RequestInspectorMiddleware)
|
2017-03-10 02:28:20 +00:00
|
|
|
|
2011-10-08 21:36:38 +00:00
|
|
|
# Settings specified here will take precedence over those in config/application.rb
|
|
|
|
|
|
|
|
# The test environment is used exclusively to run your application's
|
2012-11-14 13:45:15 +00:00
|
|
|
# test suite. You never need to work with it otherwise. Remember that
|
2011-10-08 21:36:38 +00:00
|
|
|
# your test database is "scratch space" for the test suite and is wiped
|
2012-11-14 13:45:15 +00:00
|
|
|
# and recreated between test runs. Don't rely on the data there!
|
2017-04-14 21:54:36 +00:00
|
|
|
|
|
|
|
# Enabling caching of classes slows start-up time because all controllers
|
2019-05-20 14:11:44 +00:00
|
|
|
# are loaded at initialization, but it reduces memory and load because files
|
2017-04-14 21:54:36 +00:00
|
|
|
# are not reloaded with every request. For example, caching is not necessary
|
|
|
|
# for loading database migrations but useful for handling Knapsack specs.
|
|
|
|
config.cache_classes = ENV['CACHE_CLASSES'] == 'true'
|
2011-10-08 21:36:38 +00:00
|
|
|
|
|
|
|
# Configure static asset server for tests with Cache-Control for performance
|
2017-10-03 14:47:56 +00:00
|
|
|
config.assets.compile = false if ENV['CI']
|
2018-03-21 22:37:57 +00:00
|
|
|
|
2018-12-07 18:15:06 +00:00
|
|
|
config.public_file_server.enabled = true
|
|
|
|
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
2018-03-21 22:37:57 +00:00
|
|
|
|
2011-10-08 21:36:38 +00:00
|
|
|
# Show full error reports and disable caching
|
2019-06-25 17:54:42 +00:00
|
|
|
config.active_record.verbose_query_logs = true
|
2011-10-08 21:36:38 +00:00
|
|
|
config.consider_all_requests_local = true
|
|
|
|
config.action_controller.perform_caching = false
|
|
|
|
|
|
|
|
# Raise exceptions instead of rendering exception templates
|
|
|
|
config.action_dispatch.show_exceptions = false
|
|
|
|
|
|
|
|
# Disable request forgery protection in test environment
|
2016-05-11 02:58:06 +00:00
|
|
|
config.action_controller.allow_forgery_protection = false
|
2011-10-08 21:36:38 +00:00
|
|
|
|
|
|
|
# Tell Action Mailer not to deliver emails to the real world.
|
|
|
|
# The :test delivery method accumulates sent emails in the
|
|
|
|
# ActionMailer::Base.deliveries array.
|
|
|
|
config.action_mailer.delivery_method = :test
|
|
|
|
|
|
|
|
# Print deprecation notices to the stderr
|
|
|
|
config.active_support.deprecation = :stderr
|
2013-12-06 15:04:18 +00:00
|
|
|
|
2019-04-26 15:49:19 +00:00
|
|
|
config.eager_load = true
|
2015-11-16 10:18:31 +00:00
|
|
|
|
|
|
|
config.cache_store = :null_store
|
2015-11-30 09:21:10 +00:00
|
|
|
|
|
|
|
config.active_job.queue_adapter = :test
|
2017-07-13 14:51:37 +00:00
|
|
|
|
|
|
|
if ENV['CI'] && !ENV['RAILS_ENABLE_TEST_LOG']
|
2017-07-20 08:39:21 +00:00
|
|
|
config.logger = ActiveSupport::TaggedLogging.new(Logger.new(nil))
|
2017-07-13 14:51:37 +00:00
|
|
|
config.log_level = :fatal
|
|
|
|
end
|
2011-10-08 21:36:38 +00:00
|
|
|
end
|