-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3931 from DataDog/tonycthsu/ssi-entry-point
Split single step instrument entry point
- Loading branch information
Showing
5 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
# | ||
# Entrypoint file for single step instrumentation. | ||
# | ||
# This file's path is private. Do not reference this file. | ||
# | ||
begin | ||
require_relative 'auto_instrument' | ||
rescue StandardError, LoadError => e | ||
warn "Single step instrumentation failed: #{e.class}:#{e.message}\n\tSource:\n\t#{Array(e.backtrace).join("\n\t")}" | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
RSpec.describe 'Single step instrument', skip: !Process.respond_to?(:fork) do | ||
it do | ||
expect_in_fork do | ||
expect_any_instance_of(Object) | ||
.to receive(:require_relative).with('auto_instrument').and_raise(LoadError) | ||
|
||
expect do | ||
load 'datadog/single_step_instrument.rb' | ||
end.to output(/Single step instrumentation failed/).to_stderr | ||
end | ||
end | ||
|
||
it do | ||
expect_in_fork do | ||
expect_any_instance_of(Object) | ||
.to receive(:require_relative).with('auto_instrument').and_raise(StandardError) | ||
|
||
expect do | ||
load 'datadog/single_step_instrument.rb' | ||
end.to output(/Single step instrumentation failed/).to_stderr | ||
end | ||
end | ||
end |