-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up "CI mode activated" shared context and remove hacky access t…
…o Core internals
- Loading branch information
1 parent
ebfad99
commit 003eb82
Showing
4 changed files
with
20 additions
and
32 deletions.
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
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 |
---|---|---|
@@ -1,20 +1,15 @@ | ||
RSpec.shared_context "CI mode activated" do | ||
let(:settings) do | ||
Datadog::Core::Configuration::Settings.new.tap do |settings| | ||
settings.ci.enabled = true | ||
end | ||
end | ||
|
||
let(:components) { Datadog::Core::Configuration::Components.new(settings) } | ||
let(:integration_name) { :override_me } | ||
let(:integration_options) { {} } | ||
|
||
before do | ||
# TODO: this is a very hacky way that messes with Core's internals | ||
allow_any_instance_of(Datadog::Core::Configuration).to receive(:configuration).and_return(settings) | ||
|
||
allow(Datadog::Tracing) | ||
.to receive(:tracer) | ||
.and_return(components.tracer) | ||
Datadog.configure do |c| | ||
c.ci.enabled = true | ||
c.ci.instrument integration_name, integration_options | ||
end | ||
end | ||
|
||
after { components.shutdown! } | ||
after do | ||
::Datadog::Tracing.shutdown! | ||
end | ||
end |