@@ -64,8 +64,8 @@ namespace :test do
6464 command = "bundle check || bundle install && bundle exec rake #{ spec_task } "
6565 command += "'[#{ spec_arguments } ]'" if spec_arguments
6666
67- total_executors = ENV . key? ( 'CIRCLE_NODE_TOTAL' ) ? ENV [ 'CIRCLE_NODE_TOTAL' ] . to_i : nil
68- current_executor = ENV . key? ( 'CIRCLE_NODE_INDEX' ) ? ENV [ 'CIRCLE_NODE_INDEX' ] . to_i : nil
67+ total_executors = Datadog :: DATADOG_ENV . key? ( 'CIRCLE_NODE_TOTAL' ) ? Datadog :: DATADOG_ENV [ 'CIRCLE_NODE_TOTAL' ] . to_i : nil
68+ current_executor = Datadog :: DATADOG_ENV . key? ( 'CIRCLE_NODE_INDEX' ) ? Datadog :: DATADOG_ENV [ 'CIRCLE_NODE_INDEX' ] . to_i : nil
6969
7070 if total_executors && current_executor && total_executors > 1
7171 @execution_count ||= 0
@@ -229,7 +229,12 @@ namespace :spec do
229229 t . pattern = CORE_WITH_LIBDATADOG_API . join ( ', ' )
230230 t . rspec_opts = args . to_a . join ( ' ' )
231231 end . tap do |t |
232- Rake ::Task [ t . name ] . enhance ( [ "compile:libdatadog_api.#{ RUBY_VERSION [ /\d +.\d +/ ] } _#{ RUBY_PLATFORM } " ] )
232+ Rake ::Task [ t . name ] . enhance (
233+ [
234+ "compile:libdatadog_api.#{ RUBY_VERSION [ /\d +.\d +/ ] } _#{ RUBY_PLATFORM } " ,
235+ "compile:datadog_runtime_stacks.#{ RUBY_VERSION [ /\d +.\d +/ ] } _#{ RUBY_PLATFORM } "
236+ ]
237+ )
233238 end
234239 # rubocop:enable Style/MultilineBlockChain
235240
@@ -319,7 +324,7 @@ namespace :spec do
319324 rescue => e
320325 # Compilation failed (likely unsupported Ruby version) - tests will skip gracefully
321326 puts "Warning: libdatadog_api compilation failed: #{ e . class } : #{ e } "
322- puts " DSM tests will be skipped for this Ruby version"
327+ puts ' DSM tests will be skipped for this Ruby version'
323328 end
324329
325330 DSM_ENABLED_LIBRARIES . each do |task_name |
@@ -462,11 +467,11 @@ namespace :coverage do
462467 task :report do
463468 require 'simplecov'
464469
465- resultset_files = Dir [ "#{ ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /.resultset.json" ] +
466- Dir [ "#{ ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /versions/**/.resultset.json" ]
470+ resultset_files = Dir [ "#{ Datadog :: DATADOG_ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /.resultset.json" ] +
471+ Dir [ "#{ Datadog :: DATADOG_ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /versions/**/.resultset.json" ]
467472
468473 SimpleCov . collate resultset_files do
469- coverage_dir "#{ ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /report"
474+ coverage_dir "#{ Datadog :: DATADOG_ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /report"
470475 formatter SimpleCov ::Formatter ::HTMLFormatter
471476 end
472477 end
@@ -476,11 +481,11 @@ namespace :coverage do
476481 require 'simplecov'
477482 require_relative 'spec/support/simplecov_fix'
478483
479- versions = Dir [ "#{ ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /versions/*" ] . map { |f | File . basename ( f ) }
484+ versions = Dir [ "#{ Datadog :: DATADOG_ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /versions/*" ] . map { |f | File . basename ( f ) }
480485 versions . map do |version |
481486 puts "Generating report for: #{ version } "
482- SimpleCov . collate Dir [ "#{ ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /versions/#{ version } /**/.resultset.json" ] do
483- coverage_dir "#{ ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /report/versions/#{ version } "
487+ SimpleCov . collate Dir [ "#{ Datadog :: DATADOG_ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /versions/#{ version } /**/.resultset.json" ] do
488+ coverage_dir "#{ Datadog :: DATADOG_ENV . fetch ( "COVERAGE_DIR" , "coverage" ) } /report/versions/#{ version } "
484489 formatter SimpleCov ::Formatter ::HTMLFormatter
485490 end
486491 end
@@ -500,6 +505,10 @@ NATIVE_EXTS = [
500505 ext . ext_dir = 'ext/libdatadog_api'
501506 end ,
502507
508+ Rake ::ExtensionTask . new ( "datadog_runtime_stacks.#{ RUBY_VERSION [ /\d +.\d +/ ] } _#{ RUBY_PLATFORM } " ) do |ext |
509+ ext . ext_dir = 'ext/datadog_runtime_stacks'
510+ end ,
511+
503512 Rake ::ExtensionTask . new ( "datadog_profiling_native_extension.#{ RUBY_VERSION } _#{ RUBY_PLATFORM } " ) do |ext |
504513 ext . ext_dir = 'ext/datadog_profiling_native_extension'
505514 end ,
0 commit comments