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
|
|
|
|
# are loaded at initalization, but it reduces memory and load because files
|
|
|
|
# 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
|
|
|
|
|
|
|
if Gitlab.rails5?
|
|
|
|
config.public_file_server.enabled = true
|
2018-09-07 07:21:30 +00:00
|
|
|
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
2018-03-21 22:37:57 +00:00
|
|
|
else
|
|
|
|
config.serve_static_files = true
|
2018-09-07 07:21:30 +00:00
|
|
|
config.static_cache_control = "public, max-age=3600"
|
2018-03-21 22:37:57 +00:00
|
|
|
end
|
|
|
|
|
2011-10-08 21:36:38 +00:00
|
|
|
# Show full error reports and disable caching
|
|
|
|
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
|
|
|
|
|
|
|
config.eager_load = false
|
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
|