Sha256: 51c9e189c2f41311eb438bcc2364c55e1a14243af95ca4750291064521cb4ef3

Contents?: true

Size: 1.27 KB

Versions: 13

Compression:

Stored size: 1.27 KB

Contents

require 'test_helper'
require 'sidekiq'
require 'harness/integration/sidekiq'

class SidekiqIntegrationTest < IntegrationTest
  def middleware
    Sidekiq::Middleware::Server::HarnessInstrumentation.new
  end

  def tests_logs_job_performance_stats
    middleware.call("report", nil, nil) { }

    assert_gauge_logged "report.sidekiq"
    assert_counter_logged "reports.sidekiq"
  end

  def tests_logs_a_counter_of_all_jobs
    middleware.call("reports", nil, nil) { }

    assert_counter_logged "job.sidekiq"
  end

  def test_ignores_harness_jobs
    middleware.call("Harness::SidekiqQueue::SendCounter", nil, nil) { }

    assert_empty counters
    assert_empty gauges

    middleware.call("Harness::SidekiqQueue::SendGauge", nil, nil) { }

    assert_empty counters
    assert_empty gauges

    middleware.call(Harness::SidekiqQueue::SendCounter, nil, nil) { }

    assert_empty counters
    assert_empty gauges

    middleware.call(Harness::SidekiqQueue::SendGauge, nil, nil) { }

    assert_empty counters
    assert_empty gauges

    middleware.call(Harness::SidekiqQueue::SendCounter.new, nil, nil) { }

    assert_empty counters
    assert_empty gauges

    middleware.call(Harness::SidekiqQueue::SendGauge.new, nil, nil) { }

    assert_empty counters
    assert_empty gauges
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
harness-0.9.1 test/integration/integrations/sidekiq_test.rb
harness-0.9.0 test/integration/integrations/sidekiq_test.rb
harness-0.8.1 test/integration/integrations/sidekiq_test.rb
harness-0.8.0 test/integration/integrations/sidekiq_test.rb
harness-0.7.0 test/integration/integrations/sidekiq_test.rb
harness-0.6.0 test/integration/integrations/sidekiq_test.rb
harness-0.5.0 test/integration/integrations/sidekiq_test.rb
harness-0.4.0 test/integration/integrations/sidekiq_test.rb
harness-0.3.0 test/integration/integrations/sidekiq_test.rb
harness-0.2.16 test/integration/integrations/sidekiq_test.rb
harness-0.2.15 test/integration/integrations/sidekiq_test.rb
harness-0.2.14 test/integration/integrations/sidekiq_test.rb
harness-0.2.13 test/integration/integrations/sidekiq_test.rb