mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fail CI on unknown deprecation warnings
This commit is contained in:
@@ -52,7 +52,18 @@ Openfoodnetwork::Application.configure do
|
||||
# config.active_record.schema_format = :sql
|
||||
|
||||
# Print deprecation notices to the stderr
|
||||
config.active_support.deprecation = :stderr
|
||||
# config.active_support.deprecation = :stderr
|
||||
|
||||
# Fail tests on deprecated code unless it's a known case to solve.
|
||||
ActiveSupport::Deprecation.behavior = ->(message, callstack, deprecation_horizon, gem_name) do
|
||||
allowed_warnings = [
|
||||
# List strings here to allow matching deprecations.
|
||||
"Enumerable.sum", # spec/lib/reports/bulk_coop_report_spec.rb:188
|
||||
]
|
||||
unless allowed_warnings.any? { |pattern| message.match(pattern) }
|
||||
ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:raise].call(message, callstack, deprecation_horizon, gem_name)
|
||||
end
|
||||
end
|
||||
|
||||
config.active_job.queue_adapter = :test
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user