Skip to content

Commit

Permalink
Ensure consistent environment variable during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Jul 26, 2023
1 parent 55e7a11 commit afb8bee
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/datadog/core/configuration/components_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
allow(Datadog::Core::Telemetry::Client).to receive(:new).and_return(telemetry)
end

around do |example|
ClimateControl.modify('DD_REMOTE_CONFIGURATION_ENABLED' => nil) { example.run }
end

describe '::new' do
let(:logger) { instance_double(Datadog::Core::Logger) }
let(:tracer) { instance_double(Datadog::Tracing::Tracer) }
Expand Down
4 changes: 4 additions & 0 deletions spec/datadog/core/configuration/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

let(:options) { {} }

around do |example|
ClimateControl.modify('DD_REMOTE_CONFIGURATION_ENABLED' => nil) { example.run }
end

describe '#api_key' do
subject(:api_key) { settings.api_key }

Expand Down
4 changes: 4 additions & 0 deletions spec/datadog/core/remote/component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
let(:capabilities) { Datadog::Core::Remote::Client::Capabilities.new(settings) }
let(:component) { described_class.new(settings, capabilities, agent_settings) }

around do |example|
ClimateControl.modify('DD_REMOTE_CONFIGURATION_ENABLED' => nil) { example.run }
end

describe '.build' do
subject(:build) { described_class.build(settings, agent_settings) }

Expand Down
1 change: 1 addition & 0 deletions spec/datadog/core/telemetry/emitter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

before do
allow(http_transport).to receive(:request).and_return(response)
emitter.class.sequence.reset!
end

after do
Expand Down
4 changes: 4 additions & 0 deletions spec/datadog/tracing/contrib/suite/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
require 'webrick'

RSpec.describe 'contrib integration testing' do
around do |example|
ClimateControl.modify('DD_REMOTE_CONFIGURATION_ENABLED' => nil) { example.run }
end

describe 'dynamic configuration' do
subject(:update_config) do
stub_rc!
Expand Down

0 comments on commit afb8bee

Please sign in to comment.