@@ -55,16 +55,16 @@ namespace :test do
5555
5656 candidates . each_key do |group |
5757 env = if group . empty?
58- { }
59- else
60- gemfile = AppraisalConversion . to_bundle_gemfile ( group )
61- { 'BUNDLE_GEMFILE' => gemfile }
62- end
58+ { }
59+ else
60+ gemfile = AppraisalConversion . to_bundle_gemfile ( group )
61+ { 'BUNDLE_GEMFILE' => gemfile }
62+ end
6363 command = "bundle check || bundle install && bundle exec rake #{ spec_task } "
6464 command += "'[#{ spec_arguments } ]'" if spec_arguments
6565
66- total_executors = ENV . key? ( 'CIRCLE_NODE_TOTAL' ) ? ENV [ 'CIRCLE_NODE_TOTAL' ] . to_i : nil
67- current_executor = ENV . key? ( 'CIRCLE_NODE_INDEX' ) ? ENV [ 'CIRCLE_NODE_INDEX' ] . to_i : nil
66+ total_executors = Datadog :: DATADOG_ENV . key? ( 'CIRCLE_NODE_TOTAL' ) ? Datadog :: DATADOG_ENV [ 'CIRCLE_NODE_TOTAL' ] . to_i : nil
67+ current_executor = Datadog :: DATADOG_ENV . key? ( 'CIRCLE_NODE_INDEX' ) ? Datadog :: DATADOG_ENV [ 'CIRCLE_NODE_INDEX' ] . to_i : nil
6868
6969 if total_executors && current_executor && total_executors > 1
7070 @execution_count ||= 0
@@ -82,10 +82,10 @@ desc 'Run RSpec'
8282namespace :spec do
8383 # REMINDER: If adding a new task here, make sure also add it to the `Matrixfile`
8484 task all : [ :main , :benchmark , :custom_cop ,
85- :graphql , :graphql_unified_trace_patcher , :graphql_trace_patcher , :graphql_tracing_patcher ,
86- :rails , :railsredis , :railsredis_activesupport , :railsactivejob ,
87- :elasticsearch , :http , :redis , :sidekiq , :sinatra , :hanami , :hanami_autoinstrument ,
88- :profiling , :core_with_libdatadog_api , :error_tracking , :open_feature ]
85+ :graphql , :graphql_unified_trace_patcher , :graphql_trace_patcher , :graphql_tracing_patcher ,
86+ :rails , :railsredis , :railsredis_activesupport , :railsactivejob ,
87+ :elasticsearch , :http , :redis , :sidekiq , :sinatra , :hanami , :hanami_autoinstrument ,
88+ :profiling , :core_with_libdatadog_api , :error_tracking , :open_feature ]
8989
9090 desc '' # "Explicitly hiding from `rake -T`"
9191 RSpec ::Core ::RakeTask . new ( :main ) do |t , args |
@@ -228,7 +228,12 @@ namespace :spec do
228228 t . pattern = CORE_WITH_LIBDATADOG_API . join ( ', ' )
229229 t . rspec_opts = args . to_a . join ( ' ' )
230230 end . tap do |t |
231- Rake ::Task [ t . name ] . enhance ( [ "compile:libdatadog_api.#{ RUBY_VERSION [ /\d +.\d +/ ] } _#{ RUBY_PLATFORM } " ] )
231+ Rake ::Task [ t . name ] . enhance (
232+ [
233+ "compile:libdatadog_api.#{ RUBY_VERSION [ /\d +.\d +/ ] } _#{ RUBY_PLATFORM } " ,
234+ "compile:datadog_runtime_stacks.#{ RUBY_VERSION [ /\d +.\d +/ ] } _#{ RUBY_PLATFORM } " ,
235+ ]
236+ )
232237 end
233238 # rubocop:enable Style/MultilineBlockChain
234239
@@ -318,11 +323,18 @@ namespace :spec do
318323 rescue => e
319324 # Compilation failed (likely unsupported Ruby version) - tests will skip gracefully
320325 puts "Warning: libdatadog_api compilation failed: #{ e . class } : #{ e } "
321- puts "DSM tests will be skipped for this Ruby version"
326+ puts 'DSM tests will be skipped for this Ruby version'
327+ end
328+
329+ task :compile_runtime_stacks do
330+ Rake ::Task [ "compile:datadog_runtime_stacks.#{ RUBY_VERSION [ /\d +.\d +/ ] } _#{ RUBY_PLATFORM } " ] . invoke
331+ rescue => e
332+ puts "Warning: datadog_runtime_stacks compilation failed: #{ e . class } : #{ e } "
333+ puts 'Runtime stack dependent tests will proceed without native runtime stacks support'
322334 end
323335
324336 DSM_ENABLED_LIBRARIES . each do |task_name |
325- Rake ::Task [ "spec:#{ task_name } " ] . enhance ( [ :compile_libdatadog_for_dsm ] )
337+ Rake ::Task [ "spec:#{ task_name } " ] . enhance ( [ :compile_libdatadog_for_dsm , :compile_runtime_stacks ] )
326338 end
327339 end
328340
@@ -461,11 +473,11 @@ namespace :coverage do
461473 task :report do
462474 require 'simplecov'
463475
464- resultset_files = Dir [ "#{ ENV . fetch ( " COVERAGE_DIR" , " coverage" ) } /.resultset.json" ] +
465- Dir [ "#{ ENV . fetch ( " COVERAGE_DIR" , " coverage" ) } /versions/**/.resultset.json" ]
476+ resultset_files = Dir [ "#{ Datadog :: DATADOG_ENV . fetch ( ' COVERAGE_DIR' , ' coverage' ) } /.resultset.json" ] +
477+ Dir [ "#{ Datadog :: DATADOG_ENV . fetch ( ' COVERAGE_DIR' , ' coverage' ) } /versions/**/.resultset.json" ]
466478
467479 SimpleCov . collate resultset_files do
468- coverage_dir "#{ ENV . fetch ( " COVERAGE_DIR" , " coverage" ) } /report"
480+ coverage_dir "#{ Datadog :: DATADOG_ENV . fetch ( ' COVERAGE_DIR' , ' coverage' ) } /report"
469481 formatter SimpleCov ::Formatter ::HTMLFormatter
470482 end
471483 end
@@ -475,11 +487,11 @@ namespace :coverage do
475487 require 'simplecov'
476488 require_relative 'spec/support/simplecov_fix'
477489
478- versions = Dir [ "#{ ENV . fetch ( " COVERAGE_DIR" , " coverage" ) } /versions/*" ] . map { |f | File . basename ( f ) }
490+ versions = Dir [ "#{ Datadog :: DATADOG_ENV . fetch ( ' COVERAGE_DIR' , ' coverage' ) } /versions/*" ] . map { |f | File . basename ( f ) }
479491 versions . map do |version |
480492 puts "Generating report for: #{ version } "
481- SimpleCov . collate Dir [ "#{ ENV . fetch ( " COVERAGE_DIR" , " coverage" ) } /versions/#{ version } /**/.resultset.json" ] do
482- coverage_dir "#{ ENV . fetch ( " COVERAGE_DIR" , " coverage" ) } /report/versions/#{ version } "
493+ SimpleCov . collate Dir [ "#{ Datadog :: DATADOG_ENV . fetch ( ' COVERAGE_DIR' , ' coverage' ) } /versions/#{ version } /**/.resultset.json" ] do
494+ coverage_dir "#{ Datadog :: DATADOG_ENV . fetch ( ' COVERAGE_DIR' , ' coverage' ) } /report/versions/#{ version } "
483495 formatter SimpleCov ::Formatter ::HTMLFormatter
484496 end
485497 end
@@ -499,6 +511,10 @@ NATIVE_EXTS = [
499511 ext . ext_dir = 'ext/libdatadog_api'
500512 end ,
501513
514+ Rake ::ExtensionTask . new ( "datadog_runtime_stacks.#{ RUBY_VERSION [ /\d +.\d +/ ] } _#{ RUBY_PLATFORM } " ) do |ext |
515+ ext . ext_dir = 'ext/datadog_runtime_stacks'
516+ end ,
517+
502518 Rake ::ExtensionTask . new ( "datadog_profiling_native_extension.#{ RUBY_VERSION } _#{ RUBY_PLATFORM } " ) do |ext |
503519 ext . ext_dir = 'ext/datadog_profiling_native_extension'
504520 end ,
0 commit comments