rails/activejob/test/helper.rb
Jean Boussier d917896f45 Enable verbose mode in test and report warnings as errors
We recently let a few very easy to avoid warnings get merged.
The root cause is that locally the test suite doesn't run in
verbose mode unless you explictly pass `-w`.

On CI warnings are enabled, but there is no reason to look at the
build output unless something is failing. And even if one wanted
to do that, that would be particularly work intensive since warnings
may be specific to a Ruby version etc.

Because of this I believe we should:

  - Always run the test suite with warnings enabled.
  - Raise an error if a warning is unexpected.

We've been using this pattern for a long time at Shopify both in private
and public repositories.
2022-10-11 09:25:18 +02:00

22 lines
461 B
Ruby

# frozen_string_literal: true
require "active_support/testing/strict_warnings"
require "active_job"
require "support/job_buffer"
GlobalID.app = "aj"
@adapter = ENV["AJ_ADAPTER"] ||= "inline"
puts "Using #{@adapter}"
if ENV["AJ_INTEGRATION_TESTS"]
require "support/integration/helper"
else
ActiveJob::Base.logger = Logger.new(nil)
require "adapters/#{@adapter}"
end
require "active_support/testing/autorun"
require_relative "../../tools/test_common"