Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

set queue_adapter for testing

Klaus Zanders79892edf6752
diff --git a/config/environments/test.rb b/config/environments/test.rb
index f5826c7c4b1..10fe0e723d2 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require 'active_support/core_ext/integer/time'
+require "active_support/core_ext/integer/time"
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
@@ -52,7 +52,7 @@ Rails.application.configure do
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
- config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
+ config.public_file_server.headers = { "Cache-Control" => "public, max-age=3600" }
# Show full error reports and disable caching.
config.consider_all_requests_local = true
@@ -75,11 +75,11 @@ Rails.application.configure do
config.action_mailer.delivery_method = :test
# Silence deprecations early on for testing on CI
- deprecators.silenced = ENV['CI'].present?
+ deprecators.silenced = ENV["CI"].present?
# Print deprecation notices to the stderr.
config.active_support.deprecation =
- if ENV['CI']
+ if ENV["CI"]
:silence
else
:stderr
@@ -114,11 +114,14 @@ Rails.application.configure do
# Use in-memory store for testing
Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new
- if ENV['TEST_ENV_NUMBER']
+ if ENV["TEST_ENV_NUMBER"]
assets_cache_path = Rails.root.join("tmp/cache/assets/paralleltests#{ENV['TEST_ENV_NUMBER']}")
config.assets.cache = Sprockets::Cache::FileStore.new(assets_cache_path)
end
# Speed up tests by lowering BCrypt's cost function
BCrypt::Engine.cost = BCrypt::Engine::MIN_COST
+
+ # use ActiveJob test adapter
+ config.active_job.queue_adapter = :test
end