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.
- data.tar.gz.sig +3 -2
- data/CHANGELOG +1 -1
- data/Guardfile +3 -3
- data/README.md +1 -1
- data/Rakefile +0 -2
- data/init.rb +2 -5
- data/lib/new_relic/agent.rb +3 -0
- data/lib/new_relic/agent/agent.rb +2 -0
- data/lib/new_relic/agent/configuration/default_source.rb +32 -14
- data/lib/new_relic/agent/configuration/environment_source.rb +1 -0
- data/lib/new_relic/agent/cross_app_monitor.rb +2 -2
- data/lib/new_relic/agent/cross_app_tracing.rb +2 -2
- data/lib/new_relic/agent/error_collector.rb +1 -1
- data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +4 -1
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +10 -8
- data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +11 -6
- data/lib/new_relic/agent/javascript_instrumentor.rb +27 -36
- data/lib/new_relic/agent/method_tracer.rb +20 -2
- data/lib/new_relic/agent/new_relic_service.rb +35 -27
- data/lib/new_relic/agent/request_sampler.rb +20 -13
- data/lib/new_relic/agent/sampler_collection.rb +4 -0
- data/lib/new_relic/agent/stats_engine/stats_hash.rb +4 -4
- data/lib/new_relic/agent/system_info.rb +25 -15
- data/lib/new_relic/agent/transaction.rb +23 -4
- data/lib/new_relic/agent/transaction_sampler.rb +1 -1
- data/lib/new_relic/cli/install.rb +1 -1
- data/lib/new_relic/control.rb +1 -0
- data/lib/new_relic/helper.rb +1 -29
- data/lib/new_relic/json_wrapper.rb +92 -0
- data/lib/new_relic/language_support.rb +4 -0
- data/lib/new_relic/rack/agent_hooks.rb +4 -0
- data/lib/new_relic/rack/browser_monitoring.rb +4 -0
- data/lib/new_relic/rack/developer_mode.rb +4 -1
- data/lib/new_relic/rack/error_collector.rb +5 -0
- data/lib/new_relic/rack/transaction_reset.rb +20 -0
- data/lib/new_relic/version.rb +1 -1
- data/lib/tasks/install.rake +0 -1
- data/newrelic_rpm.gemspec +1 -1
- data/test/agent_helper.rb +7 -8
- data/test/environments/norails/Gemfile +2 -1
- data/test/environments/rails21/Gemfile +2 -2
- data/test/environments/rails21/config/environment.rb +1 -3
- data/test/environments/rails21/config/environments/development.rb +0 -6
- data/test/environments/rails22/Gemfile +2 -2
- data/test/environments/rails22/config/environment.rb +0 -2
- data/test/environments/rails22/config/environments/development.rb +0 -6
- data/test/environments/rails23/Gemfile +2 -3
- data/test/environments/rails23/config/environment.rb +0 -9
- data/test/environments/rails23/config/environments/development.rb +0 -5
- data/test/environments/rails30/Gemfile +2 -2
- data/test/environments/rails31/Gemfile +2 -2
- data/test/environments/rails32/Gemfile +2 -1
- data/test/environments/rails40/Gemfile +2 -1
- data/test/intentional_fail.rb +1 -2
- data/test/multiverse/lib/multiverse/envfile.rb +1 -5
- data/test/multiverse/lib/multiverse/suite.rb +10 -27
- data/test/multiverse/suites/active_record/ar_method_aliasing.rb +49 -67
- data/test/multiverse/suites/agent_only/encoding_handling_test.rb +128 -0
- data/test/multiverse/suites/agent_only/marshaling_test.rb +7 -9
- data/test/multiverse/suites/agent_only/script/loading.rb +20 -0
- data/test/multiverse/suites/agent_only/start_up_test.rb +7 -0
- data/test/multiverse/suites/bare/Envfile +3 -0
- data/test/multiverse/suites/bare/standalone_instrumentation_test.rb +43 -0
- data/test/multiverse/suites/rails/Envfile +0 -2
- data/test/multiverse/suites/rails/app/views/views/_a_partial.html.erb +1 -0
- data/test/multiverse/suites/rails/app/views/views/index.html.erb +1 -1
- data/test/multiverse/suites/rails/error_tracing_test.rb +1 -1
- data/test/multiverse/suites/rails/request_statistics_test.rb +9 -4
- data/test/multiverse/suites/rails/view_instrumentation_test.rb +111 -106
- data/test/multiverse/suites/typhoeus/Envfile +1 -1
- data/test/multiverse/suites/typhoeus/typhoeus_test.rb +16 -2
- data/test/multiverse/test/multiverse_test.rb +2 -2
- data/test/new_relic/agent/agent/connect_test.rb +1 -1
- data/test/new_relic/agent/agent/start_test.rb +1 -1
- data/test/new_relic/agent/agent/start_worker_thread_test.rb +1 -1
- data/test/new_relic/agent/agent_logger_test.rb +3 -7
- data/test/new_relic/agent/agent_test.rb +33 -57
- data/test/new_relic/agent/apdex_from_server_test.rb +1 -1
- data/test/new_relic/agent/audit_logger_test.rb +5 -8
- data/test/new_relic/agent/autostart_test.rb +1 -1
- data/test/new_relic/agent/browser_token_test.rb +1 -1
- data/test/new_relic/agent/busy_calculator_test.rb +2 -4
- data/test/new_relic/agent/commands/agent_command_router_test.rb +5 -5
- data/test/new_relic/agent/commands/agent_command_test.rb +1 -1
- data/test/new_relic/agent/commands/thread_profiler_session_test.rb +6 -6
- data/test/new_relic/agent/commands/xray_session_collection_test.rb +10 -10
- data/test/new_relic/agent/commands/xray_session_test.rb +1 -1
- data/test/new_relic/agent/configuration/default_source_test.rb +4 -4
- data/test/new_relic/agent/configuration/environment_source_test.rb +14 -2
- data/test/new_relic/agent/configuration/manager_test.rb +3 -3
- data/test/new_relic/agent/configuration/orphan_configuration_test.rb +1 -1
- data/test/new_relic/agent/configuration/server_source_test.rb +1 -1
- data/test/new_relic/agent/configuration/yaml_source_test.rb +2 -2
- data/test/new_relic/agent/cpu_sampler_test.rb +1 -1
- data/test/new_relic/agent/cross_app_monitor_test.rb +3 -3
- data/test/new_relic/agent/cross_app_tracing_test.rb +5 -4
- data/test/new_relic/agent/database_test.rb +1 -1
- data/test/new_relic/agent/datastores/mongo/metric_generator_test.rb +1 -1
- data/test/new_relic/agent/datastores/mongo/metric_translator_test.rb +1 -1
- data/test/new_relic/agent/datastores/mongo/obfuscator_test.rb +1 -1
- data/test/new_relic/agent/datastores/mongo/statement_formatter_test.rb +2 -2
- data/test/new_relic/agent/error_collector/notice_error_test.rb +1 -1
- data/test/new_relic/agent/error_collector_test.rb +5 -3
- data/test/new_relic/agent/event_listener_test.rb +1 -1
- data/test/new_relic/agent/harvester_test.rb +1 -1
- data/test/new_relic/agent/http_clients/uri_util_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/action_controller_subscriber_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/action_view_subscriber_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/active_record_helper_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +495 -495
- data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +2 -2
- data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/instrumentation_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/metric_frame_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +4 -6
- data/test/new_relic/agent/instrumentation/queue_time_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/rack_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/sinatra/transaction_namer_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/sinatra_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +7 -7
- data/test/new_relic/agent/javascript_instrumentor_test.rb +47 -55
- data/test/new_relic/agent/memcache_instrumentation_test.rb +1 -1
- data/test/new_relic/agent/memory_logger_test.rb +1 -1
- data/test/new_relic/agent/method_interrobang_test.rb +2 -3
- data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +4 -4
- data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +1 -1
- data/test/new_relic/agent/method_tracer_test.rb +6 -7
- data/test/new_relic/agent/method_visibility_test.rb +1 -1
- data/test/new_relic/agent/new_relic_service_test.rb +129 -19
- data/test/new_relic/agent/obfuscator_test.rb +1 -1
- data/test/new_relic/agent/pipe_channel_manager_test.rb +143 -145
- data/test/new_relic/agent/pipe_service_test.rb +2 -4
- data/test/new_relic/agent/request_sampler_test.rb +23 -19
- data/test/new_relic/agent/rpm_agent_test.rb +3 -3
- data/test/new_relic/agent/rules_engine_test.rb +1 -1
- data/test/new_relic/agent/sampled_buffer_test.rb +1 -1
- data/test/new_relic/agent/sampler_collection_test.rb +3 -3
- data/test/new_relic/agent/sampler_test.rb +1 -1
- data/test/new_relic/agent/shim_agent_test.rb +1 -1
- data/test/new_relic/agent/sql_sampler_test.rb +4 -6
- data/test/new_relic/agent/stats_engine/gc_profiler_test.rb +1 -1
- data/test/new_relic/agent/stats_engine/metric_stats_test.rb +5 -5
- data/test/new_relic/agent/stats_engine/samplers_test.rb +2 -2
- data/test/new_relic/agent/stats_engine_test.rb +3 -3
- data/test/new_relic/agent/stats_hash_test.rb +2 -2
- data/test/new_relic/agent/stats_test.rb +1 -1
- data/test/new_relic/agent/threading/agent_thread_test.rb +2 -4
- data/test/new_relic/agent/threading/backtrace_node_test.rb +1 -1
- data/test/new_relic/agent/threading/backtrace_service_test.rb +5 -5
- data/test/new_relic/agent/threading/thread_profile_test.rb +1 -1
- data/test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb +1 -1
- data/test/new_relic/agent/transaction/force_persist_sample_buffer_test.rb +1 -1
- data/test/new_relic/agent/transaction/pop_test.rb +1 -1
- data/test/new_relic/agent/transaction/slowest_sample_buffer_test.rb +1 -1
- data/test/new_relic/agent/transaction/xray_sample_buffer_test.rb +1 -1
- data/test/new_relic/agent/transaction_interrobang_test.rb +2 -3
- data/test/new_relic/agent/transaction_sample_builder_test.rb +16 -14
- data/test/new_relic/agent/transaction_sampler_test.rb +16 -21
- data/test/new_relic/agent/transaction_state_test.rb +1 -1
- data/test/new_relic/agent/transaction_test.rb +61 -1
- data/test/new_relic/agent/transaction_timings_test.rb +1 -1
- data/test/new_relic/agent/worker_loop_test.rb +1 -1
- data/test/new_relic/agent_test.rb +2 -3
- data/test/new_relic/cli/deployments_test.rb +3 -3
- data/test/new_relic/coerce_test.rb +1 -1
- data/test/new_relic/collection_helper_test.rb +1 -1
- data/test/new_relic/control/class_methods_test.rb +2 -2
- data/test/new_relic/control/frameworks/rails_test.rb +1 -1
- data/test/new_relic/control_test.rb +9 -4
- data/test/new_relic/dependency_detection_test.rb +1 -1
- data/test/new_relic/dispatcher_test.rb +1 -1
- data/test/new_relic/environment_report_test.rb +4 -6
- data/test/new_relic/fake_collector.rb +1 -158
- data/test/new_relic/framework_test.rb +2 -1
- data/test/new_relic/http_client_test_cases.rb +2 -3
- data/test/new_relic/json_wrapper_test.rb +77 -0
- data/test/new_relic/language_support_test.rb +1 -1
- data/test/new_relic/license_test.rb +2 -2
- data/test/new_relic/load_test.rb +2 -8
- data/test/new_relic/local_environment_test.rb +1 -1
- data/test/new_relic/metric_data_test.rb +1 -1
- data/test/new_relic/metric_parser/metric_parser_test.rb +1 -1
- data/test/new_relic/metric_spec_test.rb +1 -1
- data/test/new_relic/multiverse_helpers.rb +26 -30
- data/test/new_relic/noticed_error_test.rb +1 -1
- data/test/new_relic/rack/agent_hooks_test.rb +1 -1
- data/test/new_relic/rack/all_test.rb +1 -1
- data/test/new_relic/rack/browser_monitoring_test.rb +4 -2
- data/test/new_relic/rack/deferred_instrumentation_test.rb +3 -5
- data/test/new_relic/rack/developer_mode_helper_test.rb +1 -1
- data/test/new_relic/rack/developer_mode_test.rb +1 -1
- data/test/new_relic/rack/error_collector_test.rb +8 -8
- data/test/new_relic/rack/transaction_reset_test.rb +35 -0
- data/test/new_relic/transaction_analysis/segment_summary_test.rb +2 -2
- data/test/new_relic/transaction_analysis_test.rb +1 -1
- data/test/new_relic/transaction_sample/composite_segment_test.rb +1 -1
- data/test/new_relic/transaction_sample/fake_segment_test.rb +2 -4
- data/test/new_relic/transaction_sample/segment_test.rb +3 -7
- data/test/new_relic/transaction_sample/summary_segment_test.rb +1 -1
- data/test/new_relic/transaction_sample_subtest_test.rb +1 -1
- data/test/new_relic/transaction_sample_test.rb +4 -6
- data/test/new_relic/version_number_test.rb +1 -1
- data/test/performance/lib/performance/instrumentation/gc_stats.rb +1 -1
- data/test/performance/lib/performance/json_reporter.rb +1 -1
- data/test/performance/suites/marshalling.rb +76 -0
- data/test/test_helper.rb +6 -39
- metadata +19 -12
- metadata.gz.sig +0 -0
- 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
|
data/lib/new_relic/version.rb
CHANGED
data/lib/tasks/install.rake
CHANGED
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-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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(
|
239
|
+
NewRelic::Agent::Transaction.start(transaction_type, opts || {})
|
241
240
|
val = yield
|
242
241
|
NewRelic::Agent::Transaction.stop(name)
|
243
242
|
val
|
@@ -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'
|
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
|
@@ -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
|
@@ -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
|
data/test/intentional_fail.rb
CHANGED
@@ -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
|
-
|
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, :
|
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
|
-
|
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
|
-
|
130
|
+
with_clean_env do
|
131
|
+
configure_before_bundling
|
138
132
|
|
139
|
-
|
140
|
-
|
133
|
+
gemfile_text = environments[env_index]
|
134
|
+
load_dependencies(gemfile_text, env_index)
|
141
135
|
|
142
|
-
|
143
|
-
|
144
|
-
|
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
|
-
|
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
|