Skip to content

Commit

Permalink
NH-66480: change metric default to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
xuan-cao-swi committed Jan 19, 2024
1 parent 8bdf952 commit 73a03fb
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions test/unit/oboe_init_options_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
_(options[16]).must_equal 1
_(options[17]).must_equal 1234
_(options[18]).must_equal 'http://the.proxy:1234'
_(options[20]).must_equal 0
_(options[20]).must_equal 2
end

it 'reads config vars' do
Expand Down Expand Up @@ -125,36 +125,33 @@
end

it 'checks for metric mode appoptics' do
ENV.delete('SW_APM_COLLECTOR')
ENV['SW_APM_COLLECTOR'] = 'collector.abc.bbc.appoptics.com'

SolarWindsAPM::OboeInitOptions.instance.re_init
options = SolarWindsAPM::OboeInitOptions.instance.array_for_oboe

_(options.size).must_equal 21
_(options[20]).must_equal 1
_(options[20]).must_equal 2
end

it 'checks for metric mode nighthack' do
ENV.delete('SW_APM_COLLECTOR')
ENV['SW_APM_COLLECTOR'] = 'collector.abc.bbc.solarwinds.com'

SolarWindsAPM::OboeInitOptions.instance.re_init
options = SolarWindsAPM::OboeInitOptions.instance.array_for_oboe

_(options.size).must_equal 21
_(options[20]).must_equal 0
_(options[20]).must_equal 2
end

it 'checks for metric mode default' do
ENV.delete('SW_APM_COLLECTOR')
ENV['SW_APM_COLLECTOR'] = 'www.google.ca'

SolarWindsAPM::OboeInitOptions.instance.re_init
options = SolarWindsAPM::OboeInitOptions.instance.array_for_oboe

_(options.size).must_equal 21
_(options[20]).must_equal 0
_(options[20]).must_equal 2
end

it 'checks for metric mode when sw_apm_collector is nil' do
Expand All @@ -164,13 +161,12 @@
options = SolarWindsAPM::OboeInitOptions.instance.array_for_oboe

_(options.size).must_equal 21
_(options[20]).must_equal 0
_(options[20]).must_equal 2
end

it 'checks for default certificates for ao' do
ENV.delete('SW_APM_TRUSTEDPATH')
ENV.delete('SW_APM_COLLECTOR')
ENV["SW_APM_COLLECTOR"] = 'collector.abc.abc.appoptics.com'
ENV["SW_APM_COLLECTOR"] = 'collector.appoptics.com'

SolarWindsAPM::OboeInitOptions.instance.re_init
options = SolarWindsAPM::OboeInitOptions.instance.array_for_oboe
Expand All @@ -181,7 +177,6 @@

it 'checks for default certificates for swo' do
ENV.delete('SW_APM_TRUSTEDPATH')
ENV.delete('SW_APM_COLLECTOR')
ENV["SW_APM_COLLECTOR"] = 'collector.abc.bbc.solarwinds.com'

SolarWindsAPM::OboeInitOptions.instance.re_init
Expand All @@ -192,7 +187,6 @@
end

it 'checks for customized certificates' do
ENV.delete('SW_APM_TRUSTEDPATH')
ENV['SW_APM_TRUSTEDPATH'] = "#{File.expand_path File.dirname(__FILE__)}/tmp.cert"

SolarWindsAPM::OboeInitOptions.instance.re_init
Expand Down

0 comments on commit 73a03fb

Please sign in to comment.