newrelic_rpm 3.7.1.188 → 3.7.2.190.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. data.tar.gz.sig +3 -2
  2. data/CHANGELOG +1 -1
  3. data/Guardfile +3 -3
  4. data/README.md +1 -1
  5. data/Rakefile +0 -2
  6. data/init.rb +2 -5
  7. data/lib/new_relic/agent.rb +3 -0
  8. data/lib/new_relic/agent/agent.rb +2 -0
  9. data/lib/new_relic/agent/configuration/default_source.rb +32 -14
  10. data/lib/new_relic/agent/configuration/environment_source.rb +1 -0
  11. data/lib/new_relic/agent/cross_app_monitor.rb +2 -2
  12. data/lib/new_relic/agent/cross_app_tracing.rb +2 -2
  13. data/lib/new_relic/agent/error_collector.rb +1 -1
  14. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +4 -1
  15. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +10 -8
  16. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +11 -6
  17. data/lib/new_relic/agent/javascript_instrumentor.rb +27 -36
  18. data/lib/new_relic/agent/method_tracer.rb +20 -2
  19. data/lib/new_relic/agent/new_relic_service.rb +35 -27
  20. data/lib/new_relic/agent/request_sampler.rb +20 -13
  21. data/lib/new_relic/agent/sampler_collection.rb +4 -0
  22. data/lib/new_relic/agent/stats_engine/stats_hash.rb +4 -4
  23. data/lib/new_relic/agent/system_info.rb +25 -15
  24. data/lib/new_relic/agent/transaction.rb +23 -4
  25. data/lib/new_relic/agent/transaction_sampler.rb +1 -1
  26. data/lib/new_relic/cli/install.rb +1 -1
  27. data/lib/new_relic/control.rb +1 -0
  28. data/lib/new_relic/helper.rb +1 -29
  29. data/lib/new_relic/json_wrapper.rb +92 -0
  30. data/lib/new_relic/language_support.rb +4 -0
  31. data/lib/new_relic/rack/agent_hooks.rb +4 -0
  32. data/lib/new_relic/rack/browser_monitoring.rb +4 -0
  33. data/lib/new_relic/rack/developer_mode.rb +4 -1
  34. data/lib/new_relic/rack/error_collector.rb +5 -0
  35. data/lib/new_relic/rack/transaction_reset.rb +20 -0
  36. data/lib/new_relic/version.rb +1 -1
  37. data/lib/tasks/install.rake +0 -1
  38. data/newrelic_rpm.gemspec +1 -1
  39. data/test/agent_helper.rb +7 -8
  40. data/test/environments/norails/Gemfile +2 -1
  41. data/test/environments/rails21/Gemfile +2 -2
  42. data/test/environments/rails21/config/environment.rb +1 -3
  43. data/test/environments/rails21/config/environments/development.rb +0 -6
  44. data/test/environments/rails22/Gemfile +2 -2
  45. data/test/environments/rails22/config/environment.rb +0 -2
  46. data/test/environments/rails22/config/environments/development.rb +0 -6
  47. data/test/environments/rails23/Gemfile +2 -3
  48. data/test/environments/rails23/config/environment.rb +0 -9
  49. data/test/environments/rails23/config/environments/development.rb +0 -5
  50. data/test/environments/rails30/Gemfile +2 -2
  51. data/test/environments/rails31/Gemfile +2 -2
  52. data/test/environments/rails32/Gemfile +2 -1
  53. data/test/environments/rails40/Gemfile +2 -1
  54. data/test/intentional_fail.rb +1 -2
  55. data/test/multiverse/lib/multiverse/envfile.rb +1 -5
  56. data/test/multiverse/lib/multiverse/suite.rb +10 -27
  57. data/test/multiverse/suites/active_record/ar_method_aliasing.rb +49 -67
  58. data/test/multiverse/suites/agent_only/encoding_handling_test.rb +128 -0
  59. data/test/multiverse/suites/agent_only/marshaling_test.rb +7 -9
  60. data/test/multiverse/suites/agent_only/script/loading.rb +20 -0
  61. data/test/multiverse/suites/agent_only/start_up_test.rb +7 -0
  62. data/test/multiverse/suites/bare/Envfile +3 -0
  63. data/test/multiverse/suites/bare/standalone_instrumentation_test.rb +43 -0
  64. data/test/multiverse/suites/rails/Envfile +0 -2
  65. data/test/multiverse/suites/rails/app/views/views/_a_partial.html.erb +1 -0
  66. data/test/multiverse/suites/rails/app/views/views/index.html.erb +1 -1
  67. data/test/multiverse/suites/rails/error_tracing_test.rb +1 -1
  68. data/test/multiverse/suites/rails/request_statistics_test.rb +9 -4
  69. data/test/multiverse/suites/rails/view_instrumentation_test.rb +111 -106
  70. data/test/multiverse/suites/typhoeus/Envfile +1 -1
  71. data/test/multiverse/suites/typhoeus/typhoeus_test.rb +16 -2
  72. data/test/multiverse/test/multiverse_test.rb +2 -2
  73. data/test/new_relic/agent/agent/connect_test.rb +1 -1
  74. data/test/new_relic/agent/agent/start_test.rb +1 -1
  75. data/test/new_relic/agent/agent/start_worker_thread_test.rb +1 -1
  76. data/test/new_relic/agent/agent_logger_test.rb +3 -7
  77. data/test/new_relic/agent/agent_test.rb +33 -57
  78. data/test/new_relic/agent/apdex_from_server_test.rb +1 -1
  79. data/test/new_relic/agent/audit_logger_test.rb +5 -8
  80. data/test/new_relic/agent/autostart_test.rb +1 -1
  81. data/test/new_relic/agent/browser_token_test.rb +1 -1
  82. data/test/new_relic/agent/busy_calculator_test.rb +2 -4
  83. data/test/new_relic/agent/commands/agent_command_router_test.rb +5 -5
  84. data/test/new_relic/agent/commands/agent_command_test.rb +1 -1
  85. data/test/new_relic/agent/commands/thread_profiler_session_test.rb +6 -6
  86. data/test/new_relic/agent/commands/xray_session_collection_test.rb +10 -10
  87. data/test/new_relic/agent/commands/xray_session_test.rb +1 -1
  88. data/test/new_relic/agent/configuration/default_source_test.rb +4 -4
  89. data/test/new_relic/agent/configuration/environment_source_test.rb +14 -2
  90. data/test/new_relic/agent/configuration/manager_test.rb +3 -3
  91. data/test/new_relic/agent/configuration/orphan_configuration_test.rb +1 -1
  92. data/test/new_relic/agent/configuration/server_source_test.rb +1 -1
  93. data/test/new_relic/agent/configuration/yaml_source_test.rb +2 -2
  94. data/test/new_relic/agent/cpu_sampler_test.rb +1 -1
  95. data/test/new_relic/agent/cross_app_monitor_test.rb +3 -3
  96. data/test/new_relic/agent/cross_app_tracing_test.rb +5 -4
  97. data/test/new_relic/agent/database_test.rb +1 -1
  98. data/test/new_relic/agent/datastores/mongo/metric_generator_test.rb +1 -1
  99. data/test/new_relic/agent/datastores/mongo/metric_translator_test.rb +1 -1
  100. data/test/new_relic/agent/datastores/mongo/obfuscator_test.rb +1 -1
  101. data/test/new_relic/agent/datastores/mongo/statement_formatter_test.rb +2 -2
  102. data/test/new_relic/agent/error_collector/notice_error_test.rb +1 -1
  103. data/test/new_relic/agent/error_collector_test.rb +5 -3
  104. data/test/new_relic/agent/event_listener_test.rb +1 -1
  105. data/test/new_relic/agent/harvester_test.rb +1 -1
  106. data/test/new_relic/agent/http_clients/uri_util_test.rb +1 -1
  107. data/test/new_relic/agent/instrumentation/action_controller_subscriber_test.rb +1 -1
  108. data/test/new_relic/agent/instrumentation/action_view_subscriber_test.rb +1 -1
  109. data/test/new_relic/agent/instrumentation/active_record_helper_test.rb +1 -1
  110. data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +495 -495
  111. data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +2 -2
  112. data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +1 -1
  113. data/test/new_relic/agent/instrumentation/instrumentation_test.rb +1 -1
  114. data/test/new_relic/agent/instrumentation/metric_frame_test.rb +1 -1
  115. data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +4 -6
  116. data/test/new_relic/agent/instrumentation/queue_time_test.rb +1 -1
  117. data/test/new_relic/agent/instrumentation/rack_test.rb +1 -1
  118. data/test/new_relic/agent/instrumentation/sinatra/transaction_namer_test.rb +1 -1
  119. data/test/new_relic/agent/instrumentation/sinatra_test.rb +1 -1
  120. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +7 -7
  121. data/test/new_relic/agent/javascript_instrumentor_test.rb +47 -55
  122. data/test/new_relic/agent/memcache_instrumentation_test.rb +1 -1
  123. data/test/new_relic/agent/memory_logger_test.rb +1 -1
  124. data/test/new_relic/agent/method_interrobang_test.rb +2 -3
  125. data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +4 -4
  126. data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +1 -1
  127. data/test/new_relic/agent/method_tracer_test.rb +6 -7
  128. data/test/new_relic/agent/method_visibility_test.rb +1 -1
  129. data/test/new_relic/agent/new_relic_service_test.rb +129 -19
  130. data/test/new_relic/agent/obfuscator_test.rb +1 -1
  131. data/test/new_relic/agent/pipe_channel_manager_test.rb +143 -145
  132. data/test/new_relic/agent/pipe_service_test.rb +2 -4
  133. data/test/new_relic/agent/request_sampler_test.rb +23 -19
  134. data/test/new_relic/agent/rpm_agent_test.rb +3 -3
  135. data/test/new_relic/agent/rules_engine_test.rb +1 -1
  136. data/test/new_relic/agent/sampled_buffer_test.rb +1 -1
  137. data/test/new_relic/agent/sampler_collection_test.rb +3 -3
  138. data/test/new_relic/agent/sampler_test.rb +1 -1
  139. data/test/new_relic/agent/shim_agent_test.rb +1 -1
  140. data/test/new_relic/agent/sql_sampler_test.rb +4 -6
  141. data/test/new_relic/agent/stats_engine/gc_profiler_test.rb +1 -1
  142. data/test/new_relic/agent/stats_engine/metric_stats_test.rb +5 -5
  143. data/test/new_relic/agent/stats_engine/samplers_test.rb +2 -2
  144. data/test/new_relic/agent/stats_engine_test.rb +3 -3
  145. data/test/new_relic/agent/stats_hash_test.rb +2 -2
  146. data/test/new_relic/agent/stats_test.rb +1 -1
  147. data/test/new_relic/agent/threading/agent_thread_test.rb +2 -4
  148. data/test/new_relic/agent/threading/backtrace_node_test.rb +1 -1
  149. data/test/new_relic/agent/threading/backtrace_service_test.rb +5 -5
  150. data/test/new_relic/agent/threading/thread_profile_test.rb +1 -1
  151. data/test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb +1 -1
  152. data/test/new_relic/agent/transaction/force_persist_sample_buffer_test.rb +1 -1
  153. data/test/new_relic/agent/transaction/pop_test.rb +1 -1
  154. data/test/new_relic/agent/transaction/slowest_sample_buffer_test.rb +1 -1
  155. data/test/new_relic/agent/transaction/xray_sample_buffer_test.rb +1 -1
  156. data/test/new_relic/agent/transaction_interrobang_test.rb +2 -3
  157. data/test/new_relic/agent/transaction_sample_builder_test.rb +16 -14
  158. data/test/new_relic/agent/transaction_sampler_test.rb +16 -21
  159. data/test/new_relic/agent/transaction_state_test.rb +1 -1
  160. data/test/new_relic/agent/transaction_test.rb +61 -1
  161. data/test/new_relic/agent/transaction_timings_test.rb +1 -1
  162. data/test/new_relic/agent/worker_loop_test.rb +1 -1
  163. data/test/new_relic/agent_test.rb +2 -3
  164. data/test/new_relic/cli/deployments_test.rb +3 -3
  165. data/test/new_relic/coerce_test.rb +1 -1
  166. data/test/new_relic/collection_helper_test.rb +1 -1
  167. data/test/new_relic/control/class_methods_test.rb +2 -2
  168. data/test/new_relic/control/frameworks/rails_test.rb +1 -1
  169. data/test/new_relic/control_test.rb +9 -4
  170. data/test/new_relic/dependency_detection_test.rb +1 -1
  171. data/test/new_relic/dispatcher_test.rb +1 -1
  172. data/test/new_relic/environment_report_test.rb +4 -6
  173. data/test/new_relic/fake_collector.rb +1 -158
  174. data/test/new_relic/framework_test.rb +2 -1
  175. data/test/new_relic/http_client_test_cases.rb +2 -3
  176. data/test/new_relic/json_wrapper_test.rb +77 -0
  177. data/test/new_relic/language_support_test.rb +1 -1
  178. data/test/new_relic/license_test.rb +2 -2
  179. data/test/new_relic/load_test.rb +2 -8
  180. data/test/new_relic/local_environment_test.rb +1 -1
  181. data/test/new_relic/metric_data_test.rb +1 -1
  182. data/test/new_relic/metric_parser/metric_parser_test.rb +1 -1
  183. data/test/new_relic/metric_spec_test.rb +1 -1
  184. data/test/new_relic/multiverse_helpers.rb +26 -30
  185. data/test/new_relic/noticed_error_test.rb +1 -1
  186. data/test/new_relic/rack/agent_hooks_test.rb +1 -1
  187. data/test/new_relic/rack/all_test.rb +1 -1
  188. data/test/new_relic/rack/browser_monitoring_test.rb +4 -2
  189. data/test/new_relic/rack/deferred_instrumentation_test.rb +3 -5
  190. data/test/new_relic/rack/developer_mode_helper_test.rb +1 -1
  191. data/test/new_relic/rack/developer_mode_test.rb +1 -1
  192. data/test/new_relic/rack/error_collector_test.rb +8 -8
  193. data/test/new_relic/rack/transaction_reset_test.rb +35 -0
  194. data/test/new_relic/transaction_analysis/segment_summary_test.rb +2 -2
  195. data/test/new_relic/transaction_analysis_test.rb +1 -1
  196. data/test/new_relic/transaction_sample/composite_segment_test.rb +1 -1
  197. data/test/new_relic/transaction_sample/fake_segment_test.rb +2 -4
  198. data/test/new_relic/transaction_sample/segment_test.rb +3 -7
  199. data/test/new_relic/transaction_sample/summary_segment_test.rb +1 -1
  200. data/test/new_relic/transaction_sample_subtest_test.rb +1 -1
  201. data/test/new_relic/transaction_sample_test.rb +4 -6
  202. data/test/new_relic/version_number_test.rb +1 -1
  203. data/test/performance/lib/performance/instrumentation/gc_stats.rb +1 -1
  204. data/test/performance/lib/performance/json_reporter.rb +1 -1
  205. data/test/performance/suites/marshalling.rb +76 -0
  206. data/test/test_helper.rb +6 -39
  207. metadata +19 -12
  208. metadata.gz.sig +0 -0
  209. data/test/new_relic/helper_test.rb +0 -32
@@ -45,7 +45,7 @@ end
45
45
 
46
46
  if !NewRelic::Agent::Threading::BacktraceService.is_supported?
47
47
 
48
- class ThreadProfilerUnsupportedTest < Test::Unit::TestCase
48
+ class ThreadProfilerUnsupportedTest < MiniTest::Unit::TestCase
49
49
  include ThreadProfilerSessionTestHelpers
50
50
 
51
51
  def setup
@@ -64,7 +64,7 @@ if !NewRelic::Agent::Threading::BacktraceService.is_supported?
64
64
 
65
65
  def test_wont_start_and_reports_error
66
66
  errors = nil
67
- assert_raise NewRelic::Agent::Commands::AgentCommandRouter::AgentCommandError do
67
+ assert_raises NewRelic::Agent::Commands::AgentCommandRouter::AgentCommandError do
68
68
  @profiler.handle_start_command(start_command)
69
69
  end
70
70
  assert_equal false, @profiler.running?
@@ -76,7 +76,7 @@ else
76
76
 
77
77
  require 'json'
78
78
 
79
- class ThreadProfilerSessionTest < Test::Unit::TestCase
79
+ class ThreadProfilerSessionTest < MiniTest::Unit::TestCase
80
80
  include ThreadedTestCase
81
81
  include ThreadProfilerSessionTestHelpers
82
82
 
@@ -125,7 +125,7 @@ else
125
125
  @profiler.stop(true)
126
126
  assert_false @profiler.running?
127
127
 
128
- assert_not_nil @profiler.harvest
128
+ refute_nil @profiler.harvest
129
129
  end
130
130
 
131
131
  def test_can_stop_a_running_profile_and_discard
@@ -149,7 +149,7 @@ else
149
149
 
150
150
  def test_config_can_disable_running
151
151
  with_config(:'thread_profiler.enabled' => false) do
152
- assert_raise NewRelic::Agent::Commands::AgentCommandRouter::AgentCommandError do
152
+ assert_raises NewRelic::Agent::Commands::AgentCommandRouter::AgentCommandError do
153
153
  @profiler.handle_start_command(start_command)
154
154
  end
155
155
  assert_false @profiler.running?
@@ -187,7 +187,7 @@ else
187
187
  def test_start_command_sent_twice_raises_error
188
188
  @profiler.handle_start_command(start_command)
189
189
 
190
- assert_raise NewRelic::Agent::Commands::AgentCommandRouter::AgentCommandError do
190
+ assert_raises NewRelic::Agent::Commands::AgentCommandRouter::AgentCommandError do
191
191
  @profiler.handle_start_command(start_command)
192
192
  end
193
193
  end
@@ -6,7 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_h
6
6
  require 'new_relic/agent/commands/xray_session_collection'
7
7
 
8
8
  module NewRelic::Agent::Commands
9
- class XraySessionCollectionTest < Test::Unit::TestCase
9
+ class XraySessionCollectionTest < MiniTest::Unit::TestCase
10
10
 
11
11
  attr_reader :sessions, :service
12
12
 
@@ -145,13 +145,13 @@ module NewRelic::Agent::Commands
145
145
  handle_command_for(SECOND_ID)
146
146
 
147
147
  session = sessions[SECOND_ID]
148
- assert_not_nil session.xray_session_name
149
- assert_not_nil session.requested_trace_count
150
- assert_not_nil session.duration
151
- assert_not_nil session.sample_period
152
- assert_not_nil session.run_profiler?
153
- assert_not_nil session.key_transaction_name
154
- assert_not_nil session.active?
148
+ refute_nil session.xray_session_name
149
+ refute_nil session.requested_trace_count
150
+ refute_nil session.duration
151
+ refute_nil session.sample_period
152
+ refute_nil session.run_profiler?
153
+ refute_nil session.key_transaction_name
154
+ refute_nil session.active?
155
155
  end
156
156
 
157
157
  def test_doesnt_recall_metadata_for_already_active_sessions
@@ -273,12 +273,12 @@ module NewRelic::Agent::Commands
273
273
 
274
274
  handle_command_for(SECOND_ID)
275
275
  assert_equal true, sessions.include?(SECOND_ID)
276
- assert_not_nil @backtrace_service.profiles[SECOND_TRANSACTION_NAME]
276
+ refute_nil @backtrace_service.profiles[SECOND_TRANSACTION_NAME]
277
277
 
278
278
  handle_command_for(ANOTHER_ID_FOR_SECOND)
279
279
  assert_equal false, sessions.include?(SECOND_ID)
280
280
  assert_equal true, sessions.include?(ANOTHER_ID_FOR_SECOND)
281
- assert_not_nil @backtrace_service.profiles[SECOND_TRANSACTION_NAME]
281
+ refute_nil @backtrace_service.profiles[SECOND_TRANSACTION_NAME]
282
282
  end
283
283
 
284
284
  def test_concurrency_on_access_to_sessions
@@ -6,7 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_h
6
6
  require 'new_relic/agent/commands/xray_session'
7
7
 
8
8
  module NewRelic::Agent::Commands
9
- class XraySessionTest < Test::Unit::TestCase
9
+ class XraySessionTest < MiniTest::Unit::TestCase
10
10
  def test_run_profiler
11
11
  session = XraySession.new('run_profiler' => true)
12
12
  assert session.run_profiler?
@@ -6,7 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_h
6
6
  require 'new_relic/agent/configuration/default_source'
7
7
 
8
8
  module NewRelic::Agent::Configuration
9
- class DefaultSourceTest < Test::Unit::TestCase
9
+ class DefaultSourceTest < MiniTest::Unit::TestCase
10
10
  def setup
11
11
  @default_source = DefaultSource.new
12
12
  @defaults = ::NewRelic::Agent::Configuration::DEFAULTS
@@ -14,19 +14,19 @@ module NewRelic::Agent::Configuration
14
14
 
15
15
  def test_default_values_have_a_public_setting
16
16
  @defaults.each do |config_setting, config_value|
17
- assert_not_nil config_value[:public], "Config setting: #{config_setting}"
17
+ refute_nil config_value[:public], "Config setting: #{config_setting}"
18
18
  end
19
19
  end
20
20
 
21
21
  def test_default_values_have_types
22
22
  @defaults.each do |config_setting, config_value|
23
- assert_not_nil config_value[:type], "Config setting: #{config_setting}"
23
+ refute_nil config_value[:type], "Config setting: #{config_setting}"
24
24
  end
25
25
  end
26
26
 
27
27
  def test_default_values_have_descriptions
28
28
  @defaults.each do |config_setting, config_value|
29
- assert_not_nil config_value[:description]
29
+ refute_nil config_value[:description]
30
30
  assert config_value[:description].length > 0, "Config setting: #{config_setting}"
31
31
  end
32
32
  end
@@ -6,7 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_h
6
6
  require 'new_relic/agent/configuration/environment_source'
7
7
 
8
8
  module NewRelic::Agent::Configuration
9
- class EnvironmentSourceTest < Test::Unit::TestCase
9
+ class EnvironmentSourceTest < MiniTest::Unit::TestCase
10
10
 
11
11
  def setup
12
12
  @original_env = {}
@@ -107,6 +107,18 @@ module NewRelic::Agent::Configuration
107
107
  end
108
108
  end
109
109
 
110
+ def test_set_values_from_new_relic_environment_variables_warns_unknowns
111
+ ENV['NEWRELIC_DOESNT_USE_THIS_VALUE'] = "true"
112
+ expects_logging(:info, includes("NEWRELIC_DOESNT_USE_THIS_VALUE"))
113
+ @environment_source.set_values_from_new_relic_environment_variables
114
+ end
115
+
116
+ def test_set_values_from_new_relic_environment_variables_ignores_NEW_RELIC_LOG
117
+ ENV['NEW_RELIC_LOG'] = "STDOUT"
118
+ expects_no_logging(:info)
119
+ @environment_source.set_values_from_new_relic_environment_variables
120
+ end
121
+
110
122
  def test_set_value_from_environment_variable
111
123
  ENV['NEW_RELIC_LICENSE_KEY'] = 'super rad'
112
124
  @environment_source.set_value_from_environment_variable('NEW_RELIC_LICENSE_KEY')
@@ -129,7 +141,7 @@ module NewRelic::Agent::Configuration
129
141
 
130
142
  def test_does_not_set_key_without_new_relic_related_prefix
131
143
  ENV['CONFIG_PATH'] = 'boom'
132
- assert_not_equal 'boom', EnvironmentSource.new[:config_path]
144
+ refute_equal 'boom', EnvironmentSource.new[:config_path]
133
145
  end
134
146
 
135
147
  def test_convert_environment_key_to_config_key
@@ -8,7 +8,7 @@ require 'new_relic/agent/configuration/mask_defaults'
8
8
  require 'new_relic/agent/threading/backtrace_service'
9
9
 
10
10
  module NewRelic::Agent::Configuration
11
- class ManagerTest < Test::Unit::TestCase
11
+ class ManagerTest < MiniTest::Unit::TestCase
12
12
  def setup
13
13
  # Defaults look up against the shared config, so reset and use it
14
14
  NewRelic::Agent.reset_config
@@ -52,7 +52,7 @@ module NewRelic::Agent::Configuration
52
52
  test_source[:baz] = 'baz'
53
53
  @manager.apply_config(test_source)
54
54
 
55
- assert_not_equal test_source, @manager.source(:foo)
55
+ refute_equal test_source, @manager.source(:foo)
56
56
  assert_equal test_source, @manager.source(:bar)
57
57
  assert_equal test_source, @manager.source(:baz)
58
58
 
@@ -162,7 +162,7 @@ module NewRelic::Agent::Configuration
162
162
  reported_config = @manager.to_collector_hash
163
163
 
164
164
  if supported
165
- assert_not_nil reported_config[:'thread_profiler.enabled']
165
+ refute_nil reported_config[:'thread_profiler.enabled']
166
166
  else
167
167
  assert_equal nil, reported_config[:'thread_profiler.enabled']
168
168
  end
@@ -4,7 +4,7 @@
4
4
 
5
5
  require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_helper'))
6
6
 
7
- class OrphanedConfigTest < Test::Unit::TestCase
7
+ class OrphanedConfigTest < MiniTest::Unit::TestCase
8
8
  include NewRelic::TestHelpers::FileSearching
9
9
 
10
10
  def setup
@@ -6,7 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_h
6
6
  require 'new_relic/agent/configuration/server_source'
7
7
 
8
8
  module NewRelic::Agent::Configuration
9
- class ServerSourceTest < Test::Unit::TestCase
9
+ class ServerSourceTest < MiniTest::Unit::TestCase
10
10
  def setup
11
11
  config = {
12
12
  'agent_config' => {
@@ -6,7 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_h
6
6
  require 'new_relic/agent/configuration/yaml_source'
7
7
 
8
8
  module NewRelic::Agent::Configuration
9
- class YamlSourceTest < Test::Unit::TestCase
9
+ class YamlSourceTest < MiniTest::Unit::TestCase
10
10
  def setup
11
11
  @test_yml_path = File.expand_path(File.join(File.dirname(__FILE__),
12
12
  '..','..','..',
@@ -37,7 +37,7 @@ module NewRelic::Agent::Configuration
37
37
  end
38
38
 
39
39
  def test_should_load_the_config_for_the_correct_env
40
- assert_not_equal 'the.wrong.host', @source[:host]
40
+ refute_equal 'the.wrong.host', @source[:host]
41
41
  end
42
42
 
43
43
  def test_should_convert_to_dot_notation
@@ -6,7 +6,7 @@
6
6
  require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
7
7
  require 'new_relic/agent/samplers/cpu_sampler'
8
8
 
9
- class NewRelic::Agent::Samplers::CpuSamplerTest < Test::Unit::TestCase
9
+ class NewRelic::Agent::Samplers::CpuSamplerTest < MiniTest::Unit::TestCase
10
10
 
11
11
  def setup
12
12
  @original_jruby_version = JRUBY_VERSION if defined?(JRuby)
@@ -5,7 +5,7 @@
5
5
  require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
6
6
 
7
7
  module NewRelic::Agent
8
- class CrossAppMonitorTest < Test::Unit::TestCase
8
+ class CrossAppMonitorTest < MiniTest::Unit::TestCase
9
9
  NEWRELIC_ID_HEADER = NewRelic::Agent::CrossAppMonitor::NEWRELIC_ID_HEADER
10
10
  NEWRELIC_TXN_HEADER = NewRelic::Agent::CrossAppMonitor::NEWRELIC_TXN_HEADER
11
11
 
@@ -218,7 +218,7 @@ module NewRelic::Agent
218
218
 
219
219
  def for_id(id)
220
220
  encoded_id = id == "" ? "" : Base64.encode64(id)
221
- encoded_txn_info = Base64.encode64( NewRelic.json_dump([ REF_TRANSACTION_GUID, false ]) )
221
+ encoded_txn_info = Base64.encode64( NewRelic::JSONWrapper.dump([ REF_TRANSACTION_GUID, false ]) )
222
222
 
223
223
  return {
224
224
  NEWRELIC_ID_HEADER => encoded_id,
@@ -232,7 +232,7 @@ module NewRelic::Agent
232
232
 
233
233
  def unpacked_response
234
234
  return nil unless response_app_data
235
- NewRelic.json_load(Base64.decode64(response_app_data))
235
+ NewRelic::JSONWrapper.load(Base64.decode64(response_app_data))
236
236
  end
237
237
 
238
238
  end
@@ -7,27 +7,28 @@ require 'new_relic/agent/cross_app_tracing'
7
7
 
8
8
  module NewRelic
9
9
  module Agent
10
- class CrossAppTracingTest < Test::Unit::TestCase
10
+ class CrossAppTracingTest < MiniTest::Unit::TestCase
11
11
 
12
12
  attr_reader :segment, :request, :response
13
13
 
14
14
  def setup
15
15
  @segment = stub_everything
16
16
  @request = stub_everything(:uri => URI.parse("http://newrelic.com"),
17
+ :type => "Fake",
17
18
  :method => "GET")
18
19
  @response = stub_everything
19
20
  end
20
21
 
21
22
  def test_start_trace
22
23
  t0, segment = CrossAppTracing.start_trace(request)
23
- assert_not_nil t0
24
- assert_not_nil segment
24
+ refute_nil t0
25
+ refute_nil segment
25
26
  end
26
27
 
27
28
  def test_start_trace_has_time_even_on_agent_failure
28
29
  NewRelic::Agent.instance.stats_engine.stubs(:push_scope).raises("Boom!")
29
30
  t0, segment = CrossAppTracing.start_trace(request)
30
- assert_not_nil t0
31
+ refute_nil t0
31
32
  assert_nil segment
32
33
  end
33
34
 
@@ -5,7 +5,7 @@
5
5
  require File.expand_path(File.join(File.dirname(__FILE__), '..', '..',
6
6
  'test_helper'))
7
7
  require 'new_relic/agent/database'
8
- class NewRelic::Agent::DatabaseTest < Test::Unit::TestCase
8
+ class NewRelic::Agent::DatabaseTest < MiniTest::Unit::TestCase
9
9
  def setup
10
10
  @explainer = NewRelic::Agent::Instrumentation::ActiveRecord::EXPLAINER
11
11
  end
@@ -5,7 +5,7 @@
5
5
  require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','..','test_helper'))
6
6
  require 'new_relic/agent/datastores/mongo/metric_generator'
7
7
 
8
- class NewRelic::Agent::Datastores::Mongo::MetricGeneratorTest < Test::Unit::TestCase
8
+ class NewRelic::Agent::Datastores::Mongo::MetricGeneratorTest < MiniTest::Unit::TestCase
9
9
  include ::NewRelic::TestHelpers::MongoMetricBuilder
10
10
 
11
11
  def setup
@@ -5,7 +5,7 @@
5
5
  require 'new_relic/agent/datastores/mongo/metric_translator'
6
6
  require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','..','test_helper'))
7
7
 
8
- class NewRelic::Agent::Datastores::Mongo::MetricTranslatorTest < Test::Unit::TestCase
8
+ class NewRelic::Agent::Datastores::Mongo::MetricTranslatorTest < MiniTest::Unit::TestCase
9
9
  include ::NewRelic::TestHelpers::MongoMetricBuilder
10
10
 
11
11
  def setup
@@ -9,7 +9,7 @@ module NewRelic
9
9
  module Agent
10
10
  module Datastores
11
11
  module Mongo
12
- class ObfuscatorTest < Test::Unit::TestCase
12
+ class ObfuscatorTest < MiniTest::Unit::TestCase
13
13
  def test_obfuscator_removes_values_from_statement
14
14
  selector = {
15
15
  'name' => 'soterios johnson',
@@ -9,7 +9,7 @@ module NewRelic
9
9
  module Agent
10
10
  module Datastores
11
11
  module Mongo
12
- class StatementFormatterTest < Test::Unit::TestCase
12
+ class StatementFormatterTest < MiniTest::Unit::TestCase
13
13
  DOC_STATEMENT = { :database => "multiverse",
14
14
  :collection => "tribbles",
15
15
  :operation => :insert,
@@ -31,7 +31,7 @@ module NewRelic
31
31
 
32
32
  def test_doesnt_modify_incoming_statement
33
33
  formatted = StatementFormatter.format(DOC_STATEMENT)
34
- assert_not_same DOC_STATEMENT, formatted
34
+ refute_same DOC_STATEMENT, formatted
35
35
  end
36
36
 
37
37
  def test_statement_formatter_removes_unwhitelisted_keys
@@ -3,7 +3,7 @@
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
5
  require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_helper'))
6
- class NewRelic::Agent::ErrorCollector::NoticeErrorTest < Test::Unit::TestCase
6
+ class NewRelic::Agent::ErrorCollector::NoticeErrorTest < MiniTest::Unit::TestCase
7
7
  require 'new_relic/agent/error_collector'
8
8
  include NewRelic::Agent::ErrorCollector::NoticeError
9
9
 
@@ -6,19 +6,21 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper
6
6
  require File.expand_path(File.join(File.dirname(__FILE__),'..','data_container_tests'))
7
7
  require 'new_relic/agent/internal_agent_error'
8
8
 
9
- class NewRelic::Agent::ErrorCollectorTest < Test::Unit::TestCase
9
+ class NewRelic::Agent::ErrorCollectorTest < MiniTest::Unit::TestCase
10
10
  def setup
11
- super
12
11
  @test_config = { :capture_params => true }
13
12
  NewRelic::Agent.config.apply_config(@test_config)
13
+
14
14
  @error_collector = NewRelic::Agent::ErrorCollector.new
15
15
  @error_collector.stubs(:enabled).returns(true)
16
16
 
17
+ NewRelic::Agent::TransactionState.clear
17
18
  NewRelic::Agent.instance.stats_engine.reset!
18
19
  end
19
20
 
20
21
  def teardown
21
22
  super
23
+ NewRelic::Agent::TransactionState.clear
22
24
  NewRelic::Agent.config.remove_config(@test_config)
23
25
  end
24
26
 
@@ -266,7 +268,7 @@ class NewRelic::Agent::ErrorCollectorTest < Test::Unit::TestCase
266
268
  err = @error_collector.errors.first
267
269
  assert_equal "NewRelic/AgentError", err.path
268
270
  assert_kind_of Hash, err.params
269
- assert_not_nil err.params[:stack_trace]
271
+ refute_nil err.params[:stack_trace]
270
272
  end
271
273
 
272
274
  def test_notice_agent_error_uses_exception_backtrace_if_present
@@ -4,7 +4,7 @@
4
4
 
5
5
  require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
6
6
 
7
- class EventListenerTest < Test::Unit::TestCase
7
+ class EventListenerTest < MiniTest::Unit::TestCase
8
8
 
9
9
  def setup
10
10
  @events = NewRelic::Agent::EventListener.new
@@ -7,7 +7,7 @@ require 'new_relic/agent/harvester'
7
7
 
8
8
  module NewRelic
9
9
  module Agent
10
- class HarvesterTest < Test::Unit::TestCase
10
+ class HarvesterTest < MiniTest::Unit::TestCase
11
11
 
12
12
  attr_reader :harvester
13
13
  def setup
@@ -5,7 +5,7 @@
5
5
  require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_helper'))
6
6
  require 'new_relic/agent/http_clients/uri_util'
7
7
 
8
- class URIUtilTest < Test::Unit::TestCase
8
+ class URIUtilTest < MiniTest::Unit::TestCase
9
9
 
10
10
  def test_filter_uri
11
11
  assert_filtered("http://foo.com/bar/baz",