From b8555a06527e1ce9dc5406c06fe4b4372a607cbf Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 17 Aug 2023 11:33:02 +0100 Subject: [PATCH] Disable profiler testing on Ruby 3.3 integration apps --- .../apps/rack/spec/integration/basic_spec.rb | 4 ++-- .../spec/integration/basic_spec.rb | 19 +++++++++++++------ .../rails-six/spec/integration/basic_spec.rb | 6 ++++-- .../spec/integration/basic_spec.rb | 4 ++-- .../spec/integration/basic_spec.rb | 4 ++-- ...uild_ddtrace_profiling_native_extension.rb | 4 ++-- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/integration/apps/rack/spec/integration/basic_spec.rb b/integration/apps/rack/spec/integration/basic_spec.rb index 99d4d5533ff..06d646b9d8f 100644 --- a/integration/apps/rack/spec/integration/basic_spec.rb +++ b/integration/apps/rack/spec/integration/basic_spec.rb @@ -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 diff --git a/integration/apps/rails-seven/spec/integration/basic_spec.rb b/integration/apps/rails-seven/spec/integration/basic_spec.rb index 439c5dc5243..5a53b66bcc3 100644 --- a/integration/apps/rails-seven/spec/integration/basic_spec.rb +++ b/integration/apps/rails-seven/spec/integration/basic_spec.rb @@ -1,3 +1,4 @@ +require 'spec_helper' require 'json' RSpec.describe 'Basic scenarios' do @@ -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 diff --git a/integration/apps/rails-six/spec/integration/basic_spec.rb b/integration/apps/rails-six/spec/integration/basic_spec.rb index 67635818ef6..5a53b66bcc3 100644 --- a/integration/apps/rails-six/spec/integration/basic_spec.rb +++ b/integration/apps/rails-six/spec/integration/basic_spec.rb @@ -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 diff --git a/integration/apps/sinatra2-classic/spec/integration/basic_spec.rb b/integration/apps/sinatra2-classic/spec/integration/basic_spec.rb index 434bbdcc8a2..71421fbbee5 100644 --- a/integration/apps/sinatra2-classic/spec/integration/basic_spec.rb +++ b/integration/apps/sinatra2-classic/spec/integration/basic_spec.rb @@ -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 diff --git a/integration/apps/sinatra2-modular/spec/integration/basic_spec.rb b/integration/apps/sinatra2-modular/spec/integration/basic_spec.rb index 434bbdcc8a2..71421fbbee5 100644 --- a/integration/apps/sinatra2-modular/spec/integration/basic_spec.rb +++ b/integration/apps/sinatra2-modular/spec/integration/basic_spec.rb @@ -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 diff --git a/integration/images/include/build_ddtrace_profiling_native_extension.rb b/integration/images/include/build_ddtrace_profiling_native_extension.rb index 8f6ba7493ce..0775ab311d4 100755 --- a/integration/images/include/build_ddtrace_profiling_native_extension.rb +++ b/integration/images/include/build_ddtrace_profiling_native_extension.rb @@ -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 =