Sha256: ecf4d366a1d56d79299a598d3a0a1883174bbfafe13ea315da12e4abb5f7c032

Contents?: true

Size: 1.03 KB

Versions: 25

Compression:

Stored size: 1.03 KB

Contents

require 'minitest_helper'
require 'rack/test'
require 'rack/lobster'
require 'oboe/inst/rack'

unless defined?(JRUBY_VERSION)
  Oboe::Config[:tracing_mode] = 'always'
  Oboe::Config[:sample_rate] = 1e6

  class RackTestApp < Minitest::Test
    include Rack::Test::Methods

    def app
      @app = Rack::Builder.new {
        use Rack::CommonLogger
        use Rack::ShowExceptions
        use Oboe::Rack
        map "/lobster" do
          use Rack::Lint
          run Rack::Lobster.new
        end
      }
    end

    def test_localset_sample_source
      # We make an initial call here which will force the oboe gem to retrieve
      # the sample_rate and sample_source from liboboe (via sample? method)
      get "/lobster"

      clear_all_traces

      get "/lobster"

      traces = get_all_traces
      traces.count.must_equal 3

      validate_outer_layers(traces, 'rack')

      kvs = {}
      kvs["SampleRate"] = "1000000"
      kvs["SampleSource"] = OBOE_SAMPLE_RATE_SOURCE_FILE.to_s
      validate_event_keys(traces[0], kvs)

    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
oboe-2.7.9.lynx1 test/support/liboboe_settings_test.rb
oboe-2.7.8.1-java test/support/liboboe_settings_test.rb
oboe-2.7.8.1 test/support/liboboe_settings_test.rb
oboe-2.7.7.1-java test/support/liboboe_settings_test.rb
oboe-2.7.7.1 test/support/liboboe_settings_test.rb
oboe-2.7.6.2-java test/support/liboboe_settings_test.rb
oboe-2.7.6.2 test/support/liboboe_settings_test.rb
oboe-2.7.5.1-java test/support/liboboe_settings_test.rb
oboe-2.7.5.1 test/support/liboboe_settings_test.rb
oboe-2.7.5.wolf3 test/support/liboboe_settings_test.rb
oboe-2.7.5.wolf3-java test/support/liboboe_settings_test.rb
oboe-2.7.5.wolf1 test/support/liboboe_settings_test.rb
oboe-2.7.5.wolf1-java test/support/liboboe_settings_test.rb
oboe-2.7.4.1-java test/support/liboboe_settings_test.rb
oboe-2.7.4.1 test/support/liboboe_settings_test.rb
oboe-2.7.3.1-java test/support/liboboe_settings_test.rb
oboe-2.7.3.1 test/support/liboboe_settings_test.rb
oboe-2.7.2.fuchs2 test/support/liboboe_settings_test.rb
oboe-2.7.2.fuchs1 test/support/liboboe_settings_test.rb
oboe-2.7.2.2-java test/support/liboboe_settings_test.rb