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
@@ -87,6 +87,10 @@ module NewRelic::LanguageSupport
87
87
  RUBY_VERSION >= '1.9.2'
88
88
  end
89
89
 
90
+ def supports_string_encodings?
91
+ RUBY_VERSION >= '1.9.0'
92
+ end
93
+
90
94
  def test_forkability
91
95
  child = Process.fork { exit! }
92
96
  # calling wait here doesn't seem like it should necessary, but it seems to
@@ -3,6 +3,7 @@
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
5
  require 'new_relic/agent/event_listener'
6
+ require 'new_relic/rack/transaction_reset'
6
7
 
7
8
  module NewRelic::Rack
8
9
  # This middleware is used by the agent internally, and is usually injected
@@ -16,6 +17,8 @@ module NewRelic::Rack
16
17
  @app = app
17
18
  end
18
19
 
20
+ include TransactionReset
21
+
19
22
  FIRED_FORMATS = {
20
23
  :before_call => "newrelic.agent_hooks_before_fired",
21
24
  :after_call => "newrelic.agent_hooks_after_fired"
@@ -24,6 +27,7 @@ module NewRelic::Rack
24
27
  # method required by Rack interface
25
28
  # [status, headers, response]
26
29
  def call(env)
30
+ ensure_transaction_reset(env)
27
31
  notify(:before_call, env)
28
32
  result = @app.call(env)
29
33
  notify(:after_call, env, result)
@@ -3,6 +3,7 @@
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
5
  require 'rack'
6
+ require 'new_relic/rack/transaction_reset'
6
7
 
7
8
  module NewRelic::Rack
8
9
  # This middleware is used by the agent for the Real user monitoring (RUM)
@@ -18,8 +19,11 @@ module NewRelic::Rack
18
19
  @app = app
19
20
  end
20
21
 
22
+ include TransactionReset
23
+
21
24
  # method required by Rack interface
22
25
  def call(env)
26
+ ensure_transaction_reset(env)
23
27
  result = @app.call(env) # [status, headers, response]
24
28
 
25
29
  if (NewRelic::Agent.browser_timing_header != "") && should_instrument?(env, result[0], result[1])
@@ -6,8 +6,9 @@ require 'rack'
6
6
  require 'rack/request'
7
7
  require 'rack/response'
8
8
  require 'rack/file'
9
- require 'new_relic/metric_parser/metric_parser'
10
9
  require 'new_relic/collection_helper'
10
+ require 'new_relic/metric_parser/metric_parser'
11
+ require 'new_relic/rack/transaction_reset'
11
12
 
12
13
  module NewRelic
13
14
  module Rack
@@ -33,12 +34,14 @@ module NewRelic
33
34
 
34
35
 
35
36
  include NewRelic::DeveloperModeHelper
37
+ include TransactionReset
36
38
 
37
39
  def initialize(app)
38
40
  @app = app
39
41
  end
40
42
 
41
43
  def call(env)
44
+ ensure_transaction_reset(env)
42
45
  return @app.call(env) unless /^\/newrelic/ =~ ::Rack::Request.new(env).path_info
43
46
  dup._call(env)
44
47
  end
@@ -2,6 +2,8 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
+ require 'new_relic/rack/transaction_reset'
6
+
5
7
  module NewRelic::Rack
6
8
  # This middleware is used by the agent in order to capture exceptions that
7
9
  # occur within your web application. It will normally be injected into the
@@ -15,6 +17,8 @@ module NewRelic::Rack
15
17
  @app = app
16
18
  end
17
19
 
20
+ include TransactionReset
21
+
18
22
  def params_from_env(env)
19
23
  if defined?(ActionDispatch::Request)
20
24
  # We use ActionDispatch::Request if it's available so that we can get
@@ -47,6 +51,7 @@ module NewRelic::Rack
47
51
  end
48
52
 
49
53
  def call(env)
54
+ ensure_transaction_reset(env)
50
55
  @app.call(env)
51
56
  rescue Exception => exception
52
57
  NewRelic::Agent.logger.debug "collecting %p: %s" % [ exception.class, exception.message ]
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
+
5
+ require 'new_relic/agent/transaction_state'
6
+
7
+ module NewRelic
8
+ module Rack
9
+ module TransactionReset
10
+ RESET_KEY = "newrelic.transaction_reset".freeze
11
+
12
+ def ensure_transaction_reset(env)
13
+ return if env.has_key?(RESET_KEY)
14
+
15
+ NewRelic::Agent::TransactionState.reset(nil)
16
+ env[RESET_KEY] = true
17
+ end
18
+ end
19
+ end
20
+ end
@@ -12,7 +12,7 @@ module NewRelic
12
12
 
13
13
  MAJOR = 3
14
14
  MINOR = 7
15
- TINY = 1
15
+ TINY = 2
16
16
 
17
17
  begin
18
18
  require File.join(File.dirname(__FILE__), 'build')
@@ -1,4 +1,3 @@
1
- # run unit tests for the NewRelic Agent
2
1
  namespace :newrelic do
3
2
  desc "Install a default config/newrelic.yml file"
4
3
  task :install do
data/newrelic_rpm.gemspec CHANGED
@@ -54,7 +54,7 @@ EOS
54
54
  s.add_development_dependency 'sequel', '~> 3.46.0'
55
55
  s.add_development_dependency 'pry'
56
56
  s.add_development_dependency 'guard', '~> 1.8.3' # Guard 2.0 is Ruby 1.9 only
57
- s.add_development_dependency 'guard-test', '~> 1.0.0'
57
+ s.add_development_dependency 'guard-minitest'
58
58
  s.add_development_dependency 'rb-fsevent', '~> 0.9.1'
59
59
 
60
60
  # Only sign with our private key if you can find it
data/test/agent_helper.rb CHANGED
@@ -53,14 +53,14 @@ def assert_calls_metrics(*metrics)
53
53
  first_metrics = generate_metric_counts(*metrics)
54
54
  yield
55
55
  last_metrics = generate_metric_counts(*metrics)
56
- assert_not_equal first_metrics, last_metrics, "should have changed these metrics"
56
+ refute_equal first_metrics, last_metrics, "should have changed these metrics"
57
57
  end
58
58
 
59
59
  def assert_calls_unscoped_metrics(*metrics)
60
60
  first_metrics = generate_unscoped_metric_counts(*metrics)
61
61
  yield
62
62
  last_metrics = generate_unscoped_metric_counts(*metrics)
63
- assert_not_equal first_metrics, last_metrics, "should have changed these metrics"
63
+ refute_equal first_metrics, last_metrics, "should have changed these metrics"
64
64
  end
65
65
 
66
66
  def assert_has_error(error_class)
@@ -93,7 +93,7 @@ end
93
93
  unless defined?( assert_not_includes )
94
94
  def assert_not_includes( collection, member, msg=nil )
95
95
  msg = build_message( msg, "Expected ? not to include ?", collection, member )
96
- assert_block( msg ) { !collection.include?(member) }
96
+ assert !collection.include?(member), msg
97
97
  end
98
98
  end
99
99
 
@@ -191,12 +191,12 @@ end
191
191
 
192
192
  def assert_truthy(expected, msg = nil)
193
193
  msg = build_message( msg, "Expected ? to be truthy", expected )
194
- assert_block( msg ) { expected }
194
+ assert !!expected, msg
195
195
  end
196
196
 
197
197
  def assert_falsy(expected, msg = nil)
198
198
  msg = build_message( msg, "Expected ? to be falsy", expected )
199
- assert_block( msg ) { !expected }
199
+ assert !expected, msg
200
200
  end
201
201
 
202
202
  unless defined?( assert_false )
@@ -230,14 +230,13 @@ end
230
230
  def in_transaction(*args)
231
231
  opts = (args.last && args.last.is_a?(Hash)) ? args.pop : {}
232
232
  name = args.first || 'dummy'
233
- defaults = { :type => :other }
234
- options = defaults.merge(opts)
233
+ transaction_type = (opts && opts.delete(:type)) || :other
235
234
 
236
235
  NewRelic::Agent.instance.instance_variable_set(:@transaction_sampler,
237
236
  NewRelic::Agent::TransactionSampler.new)
238
237
  NewRelic::Agent.instance.stats_engine.transaction_sampler = \
239
238
  NewRelic::Agent.instance.transaction_sampler
240
- NewRelic::Agent::Transaction.start(options[:type])
239
+ NewRelic::Agent::Transaction.start(transaction_type, opts || {})
241
240
  val = yield
242
241
  NewRelic::Agent::Transaction.stop(name)
243
242
  val
@@ -2,7 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rake'
4
4
 
5
- gem "mocha", '~>0.13.0', :require => false
5
+ gem 'minitest', '~>4.7.5'
6
+ gem 'mocha', :require => false
6
7
  gem 'rack'
7
8
  gem 'rack-test'
8
9
 
@@ -2,8 +2,8 @@ source 'http://rubygems.org'
2
2
 
3
3
  gem "rails", "~>2.1.2"
4
4
 
5
- gem "ci_reporter", "1.6.0"
6
- gem "mocha", "0.9.8"
5
+ gem 'minitest', '~>4.7.5'
6
+ gem "mocha", :require => false
7
7
  gem "jeweler", "1.4.0"
8
8
  gem "rdoc"
9
9
 
@@ -3,7 +3,7 @@
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
5
  # Specifies gem version of Rails to use when vendor/rails is not present
6
- RAILS_GEM_VERSION = '2.1.2' #unless defined? RAILS_GEM_VERSION
6
+ RAILS_GEM_VERSION = '2.1.2'
7
7
 
8
8
  # Bootstrap the Rails environment, frameworks, and default configuration
9
9
  require File.join(File.dirname(__FILE__), 'boot')
@@ -11,8 +11,6 @@ require File.join(File.dirname(__FILE__), 'boot')
11
11
  GC.enable_stats if GC.respond_to?(:enable_stats)
12
12
 
13
13
  Rails::Initializer.run do |config|
14
- config.gem 'ci_reporter', :lib => false
15
- config.gem "newrelic_rpm"
16
14
  config.time_zone = 'UTC'
17
15
 
18
16
  if defined?(JRuby)
@@ -8,9 +8,3 @@ config.action_controller.consider_all_requests_local = true
8
8
  config.action_view.debug_rjs = true
9
9
  config.action_controller.perform_caching = false
10
10
  config.action_mailer.raise_delivery_errors = false
11
- config.gem "mocha", :version => '>= 0.9.5'
12
- if defined? JRuby
13
- config.gem "jdbc-sqlite3", :lib => "sqlite3"
14
- else
15
- config.gem "sqlite3-ruby", :lib => "sqlite3"
16
- end
@@ -2,8 +2,8 @@ source 'http://rubygems.org'
2
2
 
3
3
  gem "rails", "~>2.2.3"
4
4
 
5
- gem "ci_reporter", "1.6.0"
6
- gem "mocha", "0.9.8"
5
+ gem 'minitest', '~>4.7.5'
6
+ gem "mocha", :require => false
7
7
  gem "jeweler", "1.4.0"
8
8
  gem "rdoc"
9
9
 
@@ -11,8 +11,6 @@ require File.join(File.dirname(__FILE__), 'boot')
11
11
  GC.enable_stats if GC.respond_to?(:enable_stats)
12
12
 
13
13
  Rails::Initializer.run do |config|
14
- gem 'ci_reporter'
15
- gem 'newrelic_rpm'
16
14
  config.time_zone = 'UTC'
17
15
  if defined?(JRuby)
18
16
  gem 'activerecord-jdbcmysql-adapter'
@@ -8,9 +8,3 @@ config.action_controller.consider_all_requests_local = true
8
8
  config.action_view.debug_rjs = true
9
9
  config.action_controller.perform_caching = false
10
10
  config.action_mailer.raise_delivery_errors = false
11
- config.gem "mocha", :version => '>= 0.9.5'
12
- if defined? JRuby
13
- config.gem "jdbc-sqlite3", :lib => "sqlite3"
14
- else
15
- config.gem "sqlite3-ruby", :lib => "sqlite3"
16
- end
@@ -1,10 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem "test-unit"
4
-
5
3
  gem "rails", "~> 2.3.18"
6
4
 
7
- gem "mocha", "0.9.8"
5
+ gem 'minitest', '~>4.7.5'
6
+ gem 'mocha', :require => false
8
7
  gem 'rack'
9
8
  gem 'rack-test'
10
9
  gem 'rdoc'
@@ -7,19 +7,10 @@ require File.join(File.dirname(__FILE__), 'boot')
7
7
  GC.enable_stats if GC.respond_to?(:enable_stats)
8
8
 
9
9
  Rails::Initializer.run do |config|
10
- config.gem "newrelic_rpm"
11
10
  config.action_controller.session = {
12
11
  :key => '_rails22blog_session',
13
12
  :secret => '603603ece6f4792a7a1284a903788646998ad4646ed19d5f06e2af7578660b7b39e54c685f3efa245084eaa5447684a0d8afc96742b63f0e133e8587272c71d1'
14
13
  }
15
-
16
- config.after_initialize do
17
- require "new_relic/version.rb"
18
- config.metals = []
19
- if NewRelic::VERSION::STRING =~ /^2\.1[01]/
20
- config.metals << 'Logins'
21
- end
22
- end
23
14
  end
24
15
 
25
16
  require 'application'
@@ -8,9 +8,4 @@ config.action_controller.consider_all_requests_local = true
8
8
  config.action_view.debug_rjs = true
9
9
  config.action_controller.perform_caching = false
10
10
  config.action_mailer.raise_delivery_errors = false
11
- config.gem "mocha", :version => '>= 0.9.5'
12
- if defined? JRuby
13
- #config.gem "jdbc-sqlite3", :lib => "sqlite3"
14
- else
15
- config.gem "sqlite3-ruby", :lib => "sqlite3"
16
11
  end
@@ -1,9 +1,9 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'test-unit'
4
3
  gem 'rails', '~>3.0.20'
5
4
  gem 'newrelic_rpm', :path => '../../..'
6
- gem "mocha"
5
+ gem 'minitest', '~>4.7.5'
6
+ gem 'mocha', :require => false
7
7
  gem 'rack'
8
8
  gem 'rack-test'
9
9
 
@@ -1,9 +1,9 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'test-unit'
4
3
  gem 'rails', '~>3.1.12'
5
4
  gem 'newrelic_rpm', :path => '../../..'
6
- gem "mocha"
5
+ gem 'minitest', '~>4.7.5'
6
+ gem 'mocha', :require => false
7
7
  gem 'rack'
8
8
  gem 'rack-test'
9
9
 
@@ -4,7 +4,8 @@ gem 'rake'
4
4
 
5
5
  gem 'rails', '~>3.2.15'
6
6
 
7
- gem "mocha", '~>0.13.0', :require => false
7
+ gem 'minitest', '~>4.7.5'
8
+ gem 'mocha', :require => false
8
9
  gem 'rack'
9
10
  gem 'rack-test'
10
11
 
@@ -4,7 +4,8 @@ gem 'rake'
4
4
 
5
5
  gem 'rails', '~>4.0.1'
6
6
 
7
- gem "mocha", '~>0.13.0', :require => false
7
+ gem 'minitest', '~>4.7.5'
8
+ gem 'mocha', :require => false
8
9
  gem 'rack'
9
10
  gem 'rack-test'
10
11
 
@@ -2,8 +2,7 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'test/unit'
6
- class IntentionalFail < Test::Unit::TestCase
5
+ class IntentionalFail < MiniTest::Unit::TestCase
7
6
 
8
7
  # This test suite is provided to facilitate testing that build scripts (e.g.
9
8
  # rake test) return the correct exit codes when tests fail.
@@ -7,7 +7,7 @@ module Multiverse
7
7
  # bundler
8
8
  class Envfile
9
9
  attr_accessor :file_path, :condition
10
- attr_reader :before, :after, :mode, :skip_message, :omit_mocha, :omit_collector
10
+ attr_reader :before, :after, :mode, :skip_message, :omit_collector
11
11
 
12
12
  def initialize(file_path)
13
13
  self.file_path = file_path
@@ -29,10 +29,6 @@ module Multiverse
29
29
  @gemfiles.push content
30
30
  end
31
31
 
32
- def omit_mocha!
33
- @omit_mocha = true
34
- end
35
-
36
32
  def omit_collector!
37
33
  @omit_collector = true
38
34
  end
@@ -61,7 +61,6 @@ module Multiverse
61
61
  puts bundler_out if verbose? || $? != 0
62
62
  raise "bundle command failed with (#{$?})" unless $? == 0
63
63
  Bundler.require
64
-
65
64
  end
66
65
 
67
66
  def generate_gemfile(gemfile_text, env_index, local = true)
@@ -75,13 +74,7 @@ module Multiverse
75
74
 
76
75
  rbx_gemfile_lines(f, gemfile_text)
77
76
 
78
- # We currently pin usage of mocha at the 0.9.x line for compatibility
79
- # 0.10.x had issues with the integration handlers and MiniTest on old Rubies
80
- # 0.11.x introduced syntax that breaks 1.8.6 entirely :(
81
- #
82
- # If we want to move forward to MiniTest 5.0.x, this will need to be
83
- # resolved in some fashion at that point
84
- f.puts " gem 'mocha', '~> 0.9.8', :require => false" unless environments.omit_mocha
77
+ f.puts " gem 'mocha', '0.14.0', :require => false"
85
78
 
86
79
  # Need to get Rubinius' debugger wired in, but MRI's doesn't work
87
80
  if include_debugger
@@ -134,14 +127,16 @@ module Multiverse
134
127
  end
135
128
 
136
129
  def execute_child_environment(env_index)
137
- configure_before_bundling
130
+ with_clean_env do
131
+ configure_before_bundling
138
132
 
139
- gemfile_text = environments[env_index]
140
- load_dependencies(gemfile_text, env_index)
133
+ gemfile_text = environments[env_index]
134
+ load_dependencies(gemfile_text, env_index)
141
135
 
142
- configure_child_environment
143
- execute_ruby_files
144
- trigger_test_run
136
+ configure_child_environment
137
+ execute_ruby_files
138
+ trigger_test_run
139
+ end
145
140
  end
146
141
 
147
142
  def should_serialize?
@@ -245,19 +240,10 @@ module Multiverse
245
240
 
246
241
  def configure_child_environment
247
242
  require 'minitest/unit'
248
- patch_minitest_for_old_mocha
249
243
  prevent_minitest_auto_run
250
244
  require_mocha
251
245
  end
252
246
 
253
- def patch_minitest_for_old_mocha
254
- # We use mocha 0.9 for compatibility with old Rubies
255
- # Its MiniTest integration isn't quite ok for 4.7.5, though, so patch it
256
- unless defined?(::MiniTest::Unit::TestCase::SUPPORTS_INFO_SIGNAL)
257
- ::MiniTest::Unit::TestCase.const_set("SUPPORTS_INFO_SIGNAL", false)
258
- end
259
- end
260
-
261
247
  # Rails and minitest_tu_shim both want to do MiniTest::Unit.autorun for us
262
248
  # We can't sidestep, so just gut the method to avoid doubled test runs
263
249
  def prevent_minitest_auto_run
@@ -269,10 +255,7 @@ module Multiverse
269
255
  end
270
256
 
271
257
  def require_mocha
272
- # We use an older version of mocha, so we just require mocha instead of mocha/setup
273
- unless environments.omit_mocha
274
- require 'mocha'
275
- end
258
+ require 'mocha/setup'
276
259
  end
277
260
 
278
261
  def disable_harvest_thread