Skip to content

Commit

Permalink
DI is disabled on jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Jan 14, 2025
1 parent 3c186be commit ed1b902
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions spec/datadog/core/configuration/components_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'spec_helper'
require 'datadog/di/spec_helper'
require 'datadog/profiling/spec_helper'

require 'logger'
Expand Down Expand Up @@ -119,9 +120,31 @@
settings.dynamic_instrumentation.enabled = true
end

it 'reports DI as enabled' do
expect(components.dynamic_instrumentation).to be_a(Datadog::DI::Component)
expect(extra).to eq(dynamic_instrumentation_enabled: true)
context 'MRI' do
before(:all) do
if PlatformHelpers.jruby?
skip "Test requires MRI"
end
end

it 'reports DI as enabled' do
expect(components.dynamic_instrumentation).to be_a(Datadog::DI::Component)
expect(extra).to eq(dynamic_instrumentation_enabled: true)
end
end

context 'JRuby' do
before(:all) do
unless PlatformHelpers.jruby?
skip "Test requires JRuby"
end
end

it 'reports DI as disabled' do
expect(logger).to receive(:warn).with(/cannot enable dynamic instrumentation/)
expect(components.dynamic_instrumentation).to be nil
expect(extra).to eq(dynamic_instrumentation_enabled: false)
end
end
end
end
Expand Down

0 comments on commit ed1b902

Please sign in to comment.