debian-mirror-gitlab/config/environments/test.rb

54 lines
2.2 KiB
Ruby
Raw Normal View History

2015-12-23 02:04:40 +05:30
Rails.application.configure do
2017-08-17 22:00:37 +05:30
# Make sure the middleware is inserted first in middleware chain
2018-11-08 19:23:39 +05:30
config.middleware.insert_before(ActionDispatch::Static, Gitlab::Testing::RequestBlockerMiddleware)
config.middleware.insert_before(ActionDispatch::Static, Gitlab::Testing::RequestInspectorMiddleware)
2017-08-17 22:00:37 +05:30
2014-09-02 18:07:02 +05:30
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
2017-08-17 22:00:37 +05:30
# Enabling caching of classes slows start-up time because all controllers
2019-09-04 21:01:54 +05:30
# are loaded at initialization, but it reduces memory and load because files
2017-08-17 22:00:37 +05:30
# 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'
2014-09-02 18:07:02 +05:30
# Configure static asset server for tests with Cache-Control for performance
2018-03-17 18:26:18 +05:30
config.assets.compile = false if ENV['CI']
2018-05-09 12:01:36 +05:30
2019-02-15 15:39:39 +05:30
config.public_file_server.enabled = true
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
2018-05-09 12:01:36 +05:30
2014-09-02 18:07:02 +05:30
# 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-06-02 11:05:42 +05:30
config.action_controller.allow_forgery_protection = false
2014-09-02 18:07:02 +05:30
# 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
config.eager_load = false
2015-11-26 14:37:03 +05:30
config.cache_store = :null_store
2015-12-23 02:04:40 +05:30
config.active_job.queue_adapter = :test
2017-09-10 17:25:29 +05:30
if ENV['CI'] && !ENV['RAILS_ENABLE_TEST_LOG']
config.logger = ActiveSupport::TaggedLogging.new(Logger.new(nil))
config.log_level = :fatal
end
2014-09-02 18:07:02 +05:30
end