diff options
Diffstat (limited to 'activejob/test')
-rw-r--r-- | activejob/test/cases/logging_test.rb | 9 | ||||
-rw-r--r-- | activejob/test/support/integration/adapters/sidekiq.rb | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/activejob/test/cases/logging_test.rb b/activejob/test/cases/logging_test.rb index 3d4e561117..64aae00441 100644 --- a/activejob/test/cases/logging_test.rb +++ b/activejob/test/cases/logging_test.rb @@ -4,6 +4,7 @@ require 'active_support/core_ext/numeric/time' require 'jobs/hello_job' require 'jobs/logging_job' require 'jobs/nested_job' +require 'models/person' class AdapterTest < ActiveSupport::TestCase include ActiveSupport::LogSubscriber::TestHelper @@ -65,6 +66,14 @@ class AdapterTest < ActiveSupport::TestCase LoggingJob.queue_name = original_queue_name end + def test_globalid_parameter_logging + person = Person.new(123) + LoggingJob.perform_later person + assert_match(%r{Enqueued.*gid://aj/Person/123}, @logger.messages) + assert_match(%r{Dummy, here is it: #<Person:.*>}, @logger.messages) + assert_match(%r{Performing.*gid://aj/Person/123}, @logger.messages) + end + def test_enqueue_job_logging HelloJob.perform_later "Cristian" assert_match(/Enqueued HelloJob \(Job ID: .*?\) to .*?:.*Cristian/, @logger.messages) diff --git a/activejob/test/support/integration/adapters/sidekiq.rb b/activejob/test/support/integration/adapters/sidekiq.rb index bdc61a1462..6ff18fb56a 100644 --- a/activejob/test/support/integration/adapters/sidekiq.rb +++ b/activejob/test/support/integration/adapters/sidekiq.rb @@ -48,7 +48,8 @@ module SidekiqJobsManager def can_run? begin - Sidekiq.redis(&:connect) + Sidekiq.redis(&:info) + Sidekiq.logger = nil rescue return false end |