Skip to content

Commit

Permalink
Disable profiler testing on Ruby 3.3 integration apps
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoanjo committed Aug 17, 2023
1 parent 9e812f0 commit b8555a0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 deletions.
4 changes: 2 additions & 2 deletions integration/apps/rack/spec/integration/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
it { is_expected.to be_a_kind_of(Net::HTTPOK) }
end

let(:expected_profiler_available) { RUBY_VERSION >= '2.3' }
let(:expected_profiler_available) { RUBY_VERSION >= '2.3' && !RUBY_VERSION.start_with?('3.3.') }

let(:expected_profiler_threads) do
contain_exactly(
'Datadog::Profiling::Collectors::IdleSamplingHelper',
'Datadog::Profiling::Collectors::CpuAndWallTimeWorker',
'Datadog::Profiling::Scheduler',
) if RUBY_VERSION >= '2.3.'
) if expected_profiler_available
end

context 'component checks' do
Expand Down
19 changes: 13 additions & 6 deletions integration/apps/rails-seven/spec/integration/basic_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'spec_helper'
require 'json'

RSpec.describe 'Basic scenarios' do
Expand All @@ -13,16 +14,22 @@

let(:json_result) { JSON.parse(subject.body, symbolize_names: true) }

let(:expected_profiler_available) { RUBY_VERSION >= '2.3' && !RUBY_VERSION.start_with?('3.3.') }

let(:expected_profiler_threads) do
contain_exactly(
'Datadog::Profiling::Collectors::IdleSamplingHelper',
'Datadog::Profiling::Collectors::CpuAndWallTimeWorker',
'Datadog::Profiling::Scheduler',
) if expected_profiler_available
end

it { is_expected.to be_a_kind_of(Net::HTTPOK) }

it 'should be profiling' do
expect(json_result).to include(
profiler_available: true,
profiler_threads: contain_exactly(
'Datadog::Profiling::Collectors::IdleSamplingHelper',
'Datadog::Profiling::Collectors::CpuAndWallTimeWorker',
'Datadog::Profiling::Scheduler',
),
profiler_available: expected_profiler_available,
profiler_threads: expected_profiler_threads,
)
end

Expand Down
6 changes: 4 additions & 2 deletions integration/apps/rails-six/spec/integration/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@

let(:json_result) { JSON.parse(subject.body, symbolize_names: true) }

let(:expected_profiler_available) { RUBY_VERSION >= '2.3' && !RUBY_VERSION.start_with?('3.3.') }

let(:expected_profiler_threads) do
contain_exactly(
'Datadog::Profiling::Collectors::IdleSamplingHelper',
'Datadog::Profiling::Collectors::CpuAndWallTimeWorker',
'Datadog::Profiling::Scheduler',
)
) if expected_profiler_available
end

it { is_expected.to be_a_kind_of(Net::HTTPOK) }

it 'should be profiling' do
expect(json_result).to include(
profiler_available: true,
profiler_available: expected_profiler_available,
profiler_threads: expected_profiler_threads,
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
it { is_expected.to be_a_kind_of(Net::HTTPOK) }
end

let(:expected_profiler_available) { RUBY_VERSION >= '2.3' }
let(:expected_profiler_available) { RUBY_VERSION >= '2.3' && !RUBY_VERSION.start_with?('3.3.') }

let(:expected_profiler_threads) do
contain_exactly(
'Datadog::Profiling::Collectors::IdleSamplingHelper',
'Datadog::Profiling::Collectors::CpuAndWallTimeWorker',
'Datadog::Profiling::Scheduler',
)
) if expected_profiler_available
end

context 'component checks' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
it { is_expected.to be_a_kind_of(Net::HTTPOK) }
end

let(:expected_profiler_available) { RUBY_VERSION >= '2.3' }
let(:expected_profiler_available) { RUBY_VERSION >= '2.3' && !RUBY_VERSION.start_with?('3.3.') }

let(:expected_profiler_threads) do
contain_exactly(
'Datadog::Profiling::Collectors::IdleSamplingHelper',
'Datadog::Profiling::Collectors::CpuAndWallTimeWorker',
'Datadog::Profiling::Scheduler',
)
) if expected_profiler_available
end

context 'component checks' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby

if local_gem_path = ENV['DD_DEMO_ENV_GEM_LOCAL_DDTRACE']
if RUBY_VERSION.start_with?('2.1.', '2.2.')
puts "\n== Skipping build of profiler native extension on Ruby 2.1/2.2 =="
if RUBY_VERSION.start_with?('2.1.', '2.2.', '3.3.')
puts "\n== Skipping build of profiler native extension on Ruby 2.1/2.2 + 3.3 =="
else
puts "\n== Building profiler native extension =="
success =
Expand Down

0 comments on commit b8555a0

Please sign in to comment.