Skip to content

Commit

Permalink
Fixed: Tools & tests related to 'datadog' rename.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc authored and delner committed Mar 18, 2024
1 parent eb3f53d commit 3541f74
Show file tree
Hide file tree
Showing 399 changed files with 816 additions and 806 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lib-injection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ jobs:
path: system-tests
- name: Overwrite auto inject script with commit SHA
run: |
sed -i "s~<DD_TRACE_SHA_TO_BE_REPLACED>~${{github.sha}}~g" lib-injection/auto_inject.rb
sed -i "s~<DD_TRACE_VERSION_TO_BE_REPLACED>~~g" lib-injection/auto_inject.rb
sed -i "s~<DATADOG_GEM_SHA_TO_BE_REPLACED>~${{github.sha}}~g" lib-injection/auto_inject.rb
sed -i "s~<DATADOG_GEM_VERSION_TO_BE_REPLACED>~~g" lib-injection/auto_inject.rb
- name: Build app
run: |
cp -r system-tests/lib-injection/build/docker/ruby/lib_injection_rails_app system-tests/lib-injection/build/docker/ruby/${{matrix.variant}}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
ref: 'tonycthsu/ruby-datadog-rename'
- name: Pull released image
run: |
docker pull ghcr.io/datadog/dd-trace-rb/system-tests/${{ matrix.image }}:latest
Expand Down Expand Up @@ -78,6 +79,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
ref: 'tonycthsu/ruby-datadog-rename'
- name: Checkout dd-trace-rb
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -200,6 +202,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
ref: 'tonycthsu/ruby-datadog-rename'
- name: Pull agent image
run: |
docker pull ghcr.io/datadog/dd-trace-rb/system-tests/agent:gha${{ github.run_id }}-g${{ github.sha }}
Expand Down Expand Up @@ -268,6 +271,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
ref: 'tonycthsu/ruby-datadog-rename'
- name: Retrieve logs
uses: actions/download-artifact@v3
with:
Expand Down
17 changes: 10 additions & 7 deletions benchmarks/tracing_trace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,24 +181,27 @@ def benchmark_propagation_trace_context

def benchmark_gem_loading
# This benchmark needs to be run in a clean environment where datadog is not loaded yet
output, status = Open3.capture2e('ruby', stdin_data: <<-RUBY)
raise "Datadog is already loaded" if defined?(::Datadog)
output, status = Open3.capture2e('bundle', 'exec', 'ruby', stdin_data: <<-RUBY)
raise "Datadog is already loaded" if defined?(::Datadog::Core)
VALIDATE_BENCHMARK_MODE = ENV['VALIDATE_BENCHMARK'] == 'true'
lib = File.expand_path('../lib', '#{__dir__}')
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
VALIDATE_BENCHMARK_MODE = #{VALIDATE_BENCHMARK_MODE}
require 'benchmark/ips'
Benchmark.ips do |x|
# Gem loading is quite slower than the other microbenchmarks
benchmark_time = VALIDATE_BENCHMARK_MODE ? { time: 0.001, warmup: 0 } : { time: 60, warmup: 5 }
x.config(**benchmark_time)
x.report("Gem loading") do
pid = fork { require 'datadog' }
_, status = Process.wait2(pid)
raise unless status.success?
end
x.save! "#{__FILE__}-results.json" unless VALIDATE_BENCHMARK_MODE
x.compare!
end
Expand Down
4 changes: 4 additions & 0 deletions datadog.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
# DEV: Loading gem files here is undesirable because it pollutes the application namesspace.
# DEV: In this case, `bundle exec ruby -e 'puts defined?(Datadog)'` will return `constant`
# DEV: even though `require 'datadog'` wasn't executed. But only the version file was loaded.
# DEV: We should avoid loading gem files to fetch the version here.
require 'datadog/version'

Gem::Specification.new do |spec|
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_activesupport.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_aws.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_contrib.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_contrib_old.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_core_old.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_elasticsearch_7.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_elasticsearch_8.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_graphql_1.13.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_graphql_2.0.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_hanami_1.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_http.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_multi_rack_app.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_opensearch_2.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_opensearch_3.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_opentracing.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_rack_1.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gemfiles/jruby_9.2_rack_2.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3541f74

Please sign in to comment.