appsignal 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +3 -1
- data/CHANGELOG.md +9 -0
- data/benchmark.rake +0 -4
- data/lib/appsignal/cli/diagnose.rb +4 -3
- data/lib/appsignal/integrations/capistrano/appsignal.cap +1 -1
- data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +2 -2
- data/lib/appsignal/rack/sinatra_instrumentation.rb +2 -0
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/auth_check_spec.rb +0 -2
- data/spec/lib/appsignal/capistrano2_spec.rb +40 -4
- data/spec/lib/appsignal/capistrano3_spec.rb +1 -3
- data/spec/lib/appsignal/cli/diagnose_spec.rb +12 -13
- data/spec/lib/appsignal/cli/install_spec.rb +0 -1
- data/spec/lib/appsignal/cli/notify_of_deploy_spec.rb +0 -1
- data/spec/lib/appsignal/cli_spec.rb +0 -1
- data/spec/lib/appsignal/config_spec.rb +0 -2
- data/spec/lib/appsignal/event_formatter/action_view/render_formatter_spec.rb +0 -2
- data/spec/lib/appsignal/event_formatter/active_record/instantiation_formatter_spec.rb +0 -2
- data/spec/lib/appsignal/event_formatter/active_record/sql_formatter_spec.rb +0 -2
- data/spec/lib/appsignal/event_formatter/elastic_search/search_formatter_spec.rb +0 -2
- data/spec/lib/appsignal/event_formatter/faraday/request_formatter_spec.rb +0 -2
- data/spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb +0 -2
- data/spec/lib/appsignal/event_formatter/moped/query_formatter_spec.rb +0 -2
- data/spec/lib/appsignal/event_formatter_spec.rb +0 -2
- data/spec/lib/appsignal/extension_spec.rb +0 -1
- data/spec/lib/appsignal/hooks/celluloid_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/data_mapper_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/delayed_job_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/net_http_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/passenger_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/puma_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/rake_spec.rb +0 -1
- data/spec/lib/appsignal/hooks/redis_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/sequel_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/shoryuken_spec.rb +1 -4
- data/spec/lib/appsignal/hooks/sidekiq_spec.rb +2 -3
- data/spec/lib/appsignal/hooks/unicorn_spec.rb +0 -2
- data/spec/lib/appsignal/hooks/webmachine_spec.rb +0 -3
- data/spec/lib/appsignal/hooks_spec.rb +0 -2
- data/spec/lib/appsignal/integrations/data_mapper_spec.rb +0 -1
- data/spec/lib/appsignal/integrations/grape_spec.rb +0 -2
- data/spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb +0 -1
- data/spec/lib/appsignal/integrations/object_spec.rb +0 -1
- data/spec/lib/appsignal/integrations/padrino_spec.rb +0 -2
- data/spec/lib/appsignal/integrations/railtie_spec.rb +0 -2
- data/spec/lib/appsignal/integrations/resque_active_job_spec.rb +0 -2
- data/spec/lib/appsignal/integrations/resque_spec.rb +1 -3
- data/spec/lib/appsignal/integrations/sinatra_spec.rb +0 -2
- data/spec/lib/appsignal/js_exception_transaction_spec.rb +0 -2
- data/spec/lib/appsignal/marker_spec.rb +0 -2
- data/spec/lib/appsignal/minutely_spec.rb +0 -2
- data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +0 -2
- data/spec/lib/appsignal/rack/js_exception_catcher_spec.rb +0 -2
- data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +0 -2
- data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +24 -2
- data/spec/lib/appsignal/rack/streaming_listener_spec.rb +3 -4
- data/spec/lib/appsignal/subscriber_spec.rb +0 -2
- data/spec/lib/appsignal/transaction_spec.rb +0 -2
- data/spec/lib/appsignal/transmitter_spec.rb +0 -2
- data/spec/lib/appsignal/update_active_support_spec.rb +0 -2
- data/spec/lib/appsignal/utils/params_sanitizer_spec.rb +0 -2
- data/spec/lib/appsignal/utils/query_params_sanitizer_spec.rb +0 -2
- data/spec/lib/appsignal/utils_spec.rb +0 -2
- data/spec/lib/appsignal_spec.rb +2 -3
- data/spec/spec_helper.rb +11 -25
- data/spec/support/helpers/directory_helper.rb +17 -0
- data/spec/support/helpers/very_specific_error.rb +8 -0
- metadata +7 -5
- data/circle.yml +0 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a80bbf4de405c95b2cbca06180e74dba72dd0e56
|
|
4
|
+
data.tar.gz: 43b9f3679d47469adfc74355f5589849355e84d2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69f92345497c592f802d91d97f407b87f4cf73ad3fe79f8bacbb6ee0dbb0e01e58656b01c52715592b29722be8e4fdb0d55f2b7c41918b9691769d7c602f882c
|
|
7
|
+
data.tar.gz: e2b37a993766b1538de718e2a395f92c771552c4093148d2974fe2c249d1c4dfc733b4dfbe4620cee85a9e45c40deaafc5ced69355028f2a21ae18ebf56c5eea
|
data/.rspec
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# 1.3.3
|
|
2
|
+
|
|
3
|
+
* Output AppSignal environment on `appsignal diagnose`
|
|
4
|
+
* Prevent transaction crashes on Sinatra routes with optional parameters
|
|
5
|
+
* Listen to `stage` option to Capistrano 2 for automatic environment detection
|
|
6
|
+
* Add `appsignal_env` option to Capistrano 2 to set a custom environment
|
|
7
|
+
|
|
1
8
|
# 1.3.2
|
|
2
9
|
* Add method to discard a transaction
|
|
3
10
|
* Run spec suite with warnings, fixes for warnings
|
|
@@ -23,6 +30,8 @@
|
|
|
23
30
|
* Allow overriding Padrino environment with APPSIGNAL_APP_ENV
|
|
24
31
|
* Add mkmf.log to diagnose command
|
|
25
32
|
* Allow for local install with bundler `bundle exec rake install`
|
|
33
|
+
* Listen to `stage` option to Capistrano 3 for automatic environment detection
|
|
34
|
+
* Add `appsignal_env` option to Capistrano 3 to set a custom environment
|
|
26
35
|
|
|
27
36
|
# 1.2.5
|
|
28
37
|
* Bugfix in CPU utilization calculation for host metrics
|
data/benchmark.rake
CHANGED
|
@@ -26,6 +26,7 @@ module Appsignal
|
|
|
26
26
|
|
|
27
27
|
def config
|
|
28
28
|
start_appsignal
|
|
29
|
+
puts "Environment: #{Appsignal.config.env}"
|
|
29
30
|
Appsignal.config.config_hash.each do |key, val|
|
|
30
31
|
puts "Config #{key}: #{val}"
|
|
31
32
|
end
|
|
@@ -60,12 +61,12 @@ module Appsignal
|
|
|
60
61
|
def check_ext_install
|
|
61
62
|
require 'bundler/cli'
|
|
62
63
|
require "bundler/cli/common"
|
|
63
|
-
path
|
|
64
|
-
install_log_path = "#{path
|
|
64
|
+
path = Bundler::CLI::Common.select_spec('appsignal').full_gem_path.strip
|
|
65
|
+
install_log_path = "#{path}/ext/install.log"
|
|
65
66
|
puts "Showing last lines of extension install log: #{install_log_path}"
|
|
66
67
|
puts File.read(install_log_path)
|
|
67
68
|
puts "\n"
|
|
68
|
-
mkmf_log_path = "#{path
|
|
69
|
+
mkmf_log_path = "#{path}/ext/mkmf.log"
|
|
69
70
|
if File.exist?(mkmf_log_path)
|
|
70
71
|
puts "Showing last lines of extension compilation log: #{mkmf_log_path}"
|
|
71
72
|
puts File.read(mkmf_log_path)
|
|
@@ -20,7 +20,7 @@ namespace :appsignal do
|
|
|
20
20
|
marker = Appsignal::Marker.new(marker_data, appsignal_config)
|
|
21
21
|
marker.transmit
|
|
22
22
|
else
|
|
23
|
-
puts
|
|
23
|
+
puts "Not notifying of deploy, config is not active for environment: #{env}"
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
end
|
|
@@ -7,7 +7,7 @@ module Appsignal
|
|
|
7
7
|
|
|
8
8
|
namespace :appsignal do
|
|
9
9
|
task :deploy do
|
|
10
|
-
env = fetch(:rails_env, fetch(:rack_env, 'production'))
|
|
10
|
+
env = fetch(:appsignal_env, fetch(:stage, fetch(:rails_env, fetch(:rack_env, 'production'))))
|
|
11
11
|
user = ENV['USER'] || ENV['USERNAME']
|
|
12
12
|
revision = fetch(:appsignal_revision, fetch(:current_revision))
|
|
13
13
|
|
|
@@ -31,7 +31,7 @@ module Appsignal
|
|
|
31
31
|
marker.transmit
|
|
32
32
|
end
|
|
33
33
|
else
|
|
34
|
-
puts
|
|
34
|
+
puts "Not notifying of deploy, config is not active for environment: #{env}"
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
data/lib/appsignal/version.rb
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
1
|
if capistrano2_present?
|
|
4
2
|
require 'capistrano'
|
|
5
3
|
require 'capistrano/configuration'
|
|
@@ -81,9 +79,47 @@ if capistrano2_present?
|
|
|
81
79
|
)
|
|
82
80
|
end
|
|
83
81
|
end
|
|
82
|
+
|
|
83
|
+
context "when stage is used instead of rack_env / rails_env" do
|
|
84
|
+
before do
|
|
85
|
+
@capistrano_config.unset(:rails_env)
|
|
86
|
+
@capistrano_config.set(:stage, 'stage_production')
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
it "should be instantiated with the right params" do
|
|
90
|
+
Appsignal::Config.should_receive(:new).with(
|
|
91
|
+
project_fixture_path,
|
|
92
|
+
'stage_production',
|
|
93
|
+
{:name => 'AppName'},
|
|
94
|
+
kind_of(Logger)
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
context "when appsignal_env is set" do
|
|
100
|
+
before do
|
|
101
|
+
@capistrano_config.set(:rack_env, 'rack_production')
|
|
102
|
+
@capistrano_config.set(:stage, 'stage_production')
|
|
103
|
+
@capistrano_config.set(:appsignal_env, 'appsignal_production')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
it "should prefer the appsignal_env rather than stage, rails_env and rack_env" do
|
|
107
|
+
Appsignal::Config.should_receive(:new).with(
|
|
108
|
+
project_fixture_path,
|
|
109
|
+
'appsignal_production',
|
|
110
|
+
{:name => 'AppName'},
|
|
111
|
+
kind_of(Logger)
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
end
|
|
84
115
|
end
|
|
85
116
|
|
|
86
|
-
after
|
|
117
|
+
after do
|
|
118
|
+
@capistrano_config.find_and_execute_task('appsignal:deploy')
|
|
119
|
+
@capistrano_config.unset(:stage)
|
|
120
|
+
@capistrano_config.unset(:rack_env)
|
|
121
|
+
@capistrano_config.unset(:appsignal_env)
|
|
122
|
+
end
|
|
87
123
|
end
|
|
88
124
|
|
|
89
125
|
context "send marker" do
|
|
@@ -168,7 +204,7 @@ if capistrano2_present?
|
|
|
168
204
|
it "should not send deploy marker" do
|
|
169
205
|
Appsignal::Marker.should_not_receive(:new)
|
|
170
206
|
@capistrano_config.find_and_execute_task('appsignal:deploy')
|
|
171
|
-
out_stream.string.should include('Not notifying of deploy, config is not active')
|
|
207
|
+
out_stream.string.should include('Not notifying of deploy, config is not active for environment: nonsense')
|
|
172
208
|
end
|
|
173
209
|
end
|
|
174
210
|
end
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
1
|
if capistrano3_present?
|
|
4
2
|
require 'capistrano/all'
|
|
5
3
|
require 'capistrano/deploy'
|
|
@@ -198,7 +196,7 @@ if capistrano3_present?
|
|
|
198
196
|
it "should not send deploy marker" do
|
|
199
197
|
Appsignal::Marker.should_not_receive(:new)
|
|
200
198
|
invoke('appsignal:deploy')
|
|
201
|
-
out_stream.string.should include("Not notifying of deploy, config is not active")
|
|
199
|
+
out_stream.string.should include("Not notifying of deploy, config is not active for environment: nonsense")
|
|
202
200
|
end
|
|
203
201
|
end
|
|
204
202
|
end
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
1
|
require 'appsignal/cli'
|
|
3
2
|
|
|
4
3
|
describe Appsignal::CLI::Diagnose do
|
|
5
4
|
let(:out_stream) { StringIO.new }
|
|
6
5
|
let(:cli) { Appsignal::CLI::Diagnose }
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
around do |example|
|
|
7
|
+
original_stdout = $stdout
|
|
9
8
|
$stdout = out_stream
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
$stdout = @original_stdout
|
|
9
|
+
example.run
|
|
10
|
+
$stdout = original_stdout
|
|
13
11
|
end
|
|
14
12
|
|
|
15
13
|
describe ".run" do
|
|
16
14
|
it "should output diagnostic information" do
|
|
17
15
|
cli.run
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
output = out_stream.string
|
|
17
|
+
expect(output).to include('Gem version')
|
|
18
|
+
expect(output).to include('Agent version')
|
|
19
|
+
expect(output).to include('Environment')
|
|
20
|
+
expect(output).to include('Config')
|
|
21
|
+
expect(output).to include('Checking API key')
|
|
22
|
+
expect(output).to include('Checking if required paths are writable')
|
|
23
|
+
expect(output).to include('Showing last lines of extension install log')
|
|
25
24
|
end
|
|
26
25
|
end
|
|
27
26
|
end
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
describe Appsignal::Hooks::ShoryukenMiddleware do
|
|
5
2
|
let(:current_transaction) { background_job_transaction }
|
|
6
3
|
|
|
@@ -51,7 +48,7 @@ describe Appsignal::Hooks::ShoryukenMiddleware do
|
|
|
51
48
|
end
|
|
52
49
|
|
|
53
50
|
context "with an erroring call" do
|
|
54
|
-
let(:error) { VerySpecificError.new
|
|
51
|
+
let(:error) { VerySpecificError.new }
|
|
55
52
|
|
|
56
53
|
it "should add the exception to appsignal" do
|
|
57
54
|
Appsignal::Transaction.any_instance.should_receive(:set_error).with(error)
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
1
|
describe Appsignal::Hooks::SidekiqPlugin do
|
|
4
2
|
let(:worker) { double }
|
|
5
3
|
let(:queue) { double }
|
|
@@ -79,7 +77,8 @@ describe Appsignal::Hooks::SidekiqPlugin do
|
|
|
79
77
|
end
|
|
80
78
|
|
|
81
79
|
context "with an erroring call" do
|
|
82
|
-
let(:error) { VerySpecificError.new
|
|
80
|
+
let(:error) { VerySpecificError.new }
|
|
81
|
+
|
|
83
82
|
it "should add the exception to appsignal" do
|
|
84
83
|
Appsignal::Transaction.any_instance.should_receive(:set_error).with(error)
|
|
85
84
|
end
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
1
|
if resque_present?
|
|
4
2
|
describe "Resque integration" do
|
|
5
3
|
let(:file) { File.expand_path('lib/appsignal/integrations/resque.rb') }
|
|
@@ -20,7 +18,7 @@ if resque_present?
|
|
|
20
18
|
extend Appsignal::Integrations::ResquePlugin
|
|
21
19
|
|
|
22
20
|
def self.perform
|
|
23
|
-
raise VerySpecificError.new
|
|
21
|
+
raise VerySpecificError.new
|
|
24
22
|
end
|
|
25
23
|
end
|
|
26
24
|
end
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
1
|
begin
|
|
4
2
|
require 'sinatra'
|
|
5
3
|
require 'appsignal/integrations/sinatra'
|
|
@@ -133,12 +131,28 @@ if defined?(::Sinatra)
|
|
|
133
131
|
Appsignal::Transaction.any_instance.should_receive(:set_action).with('GET /')
|
|
134
132
|
end
|
|
135
133
|
|
|
134
|
+
context "without 'sinatra.route' env" do
|
|
135
|
+
let(:env) { {:path => '/', :method => 'GET'} }
|
|
136
|
+
|
|
137
|
+
it "returns nil" do
|
|
138
|
+
Appsignal::Transaction.any_instance.should_receive(:set_action).with(nil)
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
136
142
|
context "with option to set path a mounted_at prefix" do
|
|
137
143
|
let(:options) {{ :mounted_at => "/api/v2" }}
|
|
138
144
|
|
|
139
145
|
it "should call set_action with a prefix path" do
|
|
140
146
|
Appsignal::Transaction.any_instance.should_receive(:set_action).with("GET /api/v2/")
|
|
141
147
|
end
|
|
148
|
+
|
|
149
|
+
context "without 'sinatra.route' env" do
|
|
150
|
+
let(:env) { {:path => '/', :method => 'GET'} }
|
|
151
|
+
|
|
152
|
+
it "returns nil" do
|
|
153
|
+
Appsignal::Transaction.any_instance.should_receive(:set_action).with(nil)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
142
156
|
end
|
|
143
157
|
|
|
144
158
|
context "with mounted modular application" do
|
|
@@ -147,6 +161,14 @@ if defined?(::Sinatra)
|
|
|
147
161
|
it "should call set_action with an application prefix path" do
|
|
148
162
|
Appsignal::Transaction.any_instance.should_receive(:set_action).with("GET /api/")
|
|
149
163
|
end
|
|
164
|
+
|
|
165
|
+
context "without 'sinatra.route' env" do
|
|
166
|
+
let(:env) { {:path => '/', :method => 'GET'} }
|
|
167
|
+
|
|
168
|
+
it "returns nil" do
|
|
169
|
+
Appsignal::Transaction.any_instance.should_receive(:set_action).with(nil)
|
|
170
|
+
end
|
|
171
|
+
end
|
|
150
172
|
end
|
|
151
173
|
end
|
|
152
174
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
1
|
require 'appsignal/rack/streaming_listener'
|
|
3
2
|
|
|
4
3
|
describe Appsignal::Rack::StreamingListener do
|
|
@@ -89,7 +88,7 @@ describe Appsignal::Rack::StreamingListener do
|
|
|
89
88
|
|
|
90
89
|
context "with an exception in the instrumentation call" do
|
|
91
90
|
it "should add the exception to the transaction" do
|
|
92
|
-
allow( app ).to receive(:call).and_raise(VerySpecificError.new
|
|
91
|
+
allow( app ).to receive(:call).and_raise(VerySpecificError.new)
|
|
93
92
|
|
|
94
93
|
expect( transaction ).to receive(:set_error)
|
|
95
94
|
|
|
@@ -124,7 +123,7 @@ describe Appsignal::StreamWrapper do
|
|
|
124
123
|
context "when each raises an error" do
|
|
125
124
|
it "should add the exception to the transaction" do
|
|
126
125
|
allow( stream ).to receive(:each)
|
|
127
|
-
.and_raise(VerySpecificError.new
|
|
126
|
+
.and_raise(VerySpecificError.new)
|
|
128
127
|
|
|
129
128
|
expect( transaction ).to receive(:set_error)
|
|
130
129
|
|
|
@@ -144,7 +143,7 @@ describe Appsignal::StreamWrapper do
|
|
|
144
143
|
context "when each raises an error" do
|
|
145
144
|
it "should add the exception to the transaction and close it" do
|
|
146
145
|
allow( stream ).to receive(:close)
|
|
147
|
-
.and_raise(VerySpecificError.new
|
|
146
|
+
.and_raise(VerySpecificError.new)
|
|
148
147
|
|
|
149
148
|
expect( transaction ).to receive(:set_error)
|
|
150
149
|
expect( Appsignal::Transaction ).to receive(:complete_current!)
|
data/spec/lib/appsignal_spec.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
1
|
require './spec/support/mocks/mock_extension'
|
|
3
2
|
|
|
4
3
|
describe Appsignal do
|
|
@@ -361,7 +360,7 @@ describe Appsignal do
|
|
|
361
360
|
end
|
|
362
361
|
|
|
363
362
|
context "with an erroring call" do
|
|
364
|
-
let(:error) { VerySpecificError.new
|
|
363
|
+
let(:error) { VerySpecificError.new }
|
|
365
364
|
|
|
366
365
|
it "should add the error to the current transaction and complete" do
|
|
367
366
|
Appsignal::Transaction.any_instance.should_receive(:set_error).with(error)
|
|
@@ -392,7 +391,7 @@ describe Appsignal do
|
|
|
392
391
|
end
|
|
393
392
|
|
|
394
393
|
context "with an erroring call" do
|
|
395
|
-
let(:error) { VerySpecificError.new
|
|
394
|
+
let(:error) { VerySpecificError.new }
|
|
396
395
|
|
|
397
396
|
it "should call monitor_transaction and stop and then raise the error" do
|
|
398
397
|
Appsignal.should_receive(:monitor_transaction).with(
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
ENV['RAILS_ENV'] ||= 'test'
|
|
2
2
|
ENV['PADRINO_ENV'] ||= 'test'
|
|
3
3
|
|
|
4
|
+
APPSIGNAL_SPEC_DIR = File.expand_path(File.dirname(__FILE__))
|
|
5
|
+
|
|
4
6
|
require 'rack'
|
|
5
7
|
require 'rspec'
|
|
6
8
|
require 'pry'
|
|
7
9
|
require 'timecop'
|
|
8
10
|
require 'webmock/rspec'
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
Dir[File.join(APPSIGNAL_SPEC_DIR, 'support/helpers', '*.rb')].each do |f|
|
|
13
|
+
require f
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
$LOAD_PATH.unshift(File.join(APPSIGNAL_SPEC_DIR, 'support/stubs'))
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
puts "Running specs in #{RUBY_VERSION} on #{RUBY_PLATFORM}\n\n"
|
|
13
19
|
|
|
14
20
|
begin
|
|
15
21
|
require 'rails'
|
|
@@ -21,6 +27,8 @@ rescue LoadError
|
|
|
21
27
|
RAILS_PRESENT = false
|
|
22
28
|
end
|
|
23
29
|
|
|
30
|
+
require 'appsignal'
|
|
31
|
+
|
|
24
32
|
def rails_present?
|
|
25
33
|
RAILS_PRESENT
|
|
26
34
|
end
|
|
@@ -101,26 +109,6 @@ rescue LoadError
|
|
|
101
109
|
false
|
|
102
110
|
end
|
|
103
111
|
|
|
104
|
-
require 'appsignal'
|
|
105
|
-
|
|
106
|
-
def spec_dir
|
|
107
|
-
File.dirname(__FILE__)
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def tmp_dir
|
|
111
|
-
@tmp_dir ||= File.expand_path('tmp', spec_dir)
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def fixtures_dir
|
|
115
|
-
@fixtures_dir ||= File.expand_path('support/fixtures', spec_dir)
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
def helpers_dir
|
|
119
|
-
@helpers_dir ||= File.expand_path('support/helpers', spec_dir)
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
Dir[File.join(helpers_dir, '*.rb')].each { |file| require file }
|
|
123
|
-
|
|
124
112
|
# Add way to clear subscribers between specs
|
|
125
113
|
module ActiveSupport
|
|
126
114
|
module Notifications
|
|
@@ -134,6 +122,7 @@ module ActiveSupport
|
|
|
134
122
|
end
|
|
135
123
|
|
|
136
124
|
RSpec.configure do |config|
|
|
125
|
+
config.include DirectoryHelper
|
|
137
126
|
config.include ConfigHelpers
|
|
138
127
|
config.include EnvHelpers
|
|
139
128
|
config.include NotificationHelpers
|
|
@@ -166,6 +155,3 @@ RSpec.configure do |config|
|
|
|
166
155
|
Appsignal.logger = nil
|
|
167
156
|
end
|
|
168
157
|
end
|
|
169
|
-
|
|
170
|
-
class VerySpecificError < RuntimeError
|
|
171
|
-
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module DirectoryHelper
|
|
2
|
+
def spec_dir
|
|
3
|
+
APPSIGNAL_SPEC_DIR
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
def support_dir
|
|
7
|
+
@support_dir ||= File.join(spec_dir, 'support')
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def tmp_dir
|
|
11
|
+
@tmp_dir ||= File.join(spec_dir, 'tmp')
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def fixtures_dir
|
|
15
|
+
@fixtures_dir ||= File.join(support_dir, 'fixtures')
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# This VerySpecificError is used for throwing errors in specs that are allowed
|
|
2
|
+
# or expected.
|
|
3
|
+
#
|
|
4
|
+
# For example, this error can be thrown to raise an exception in AppSignal's
|
|
5
|
+
# run, which should stop the program and the appsignal gem, but not crash the
|
|
6
|
+
# test suite.
|
|
7
|
+
class VerySpecificError < RuntimeError
|
|
8
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: appsignal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Beekman
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-09-
|
|
12
|
+
date: 2016-09-08 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rack
|
|
@@ -129,7 +129,6 @@ files:
|
|
|
129
129
|
- appsignal.gemspec
|
|
130
130
|
- benchmark.rake
|
|
131
131
|
- bin/appsignal
|
|
132
|
-
- circle.yml
|
|
133
132
|
- ext/agent.yml
|
|
134
133
|
- ext/appsignal_extension.c
|
|
135
134
|
- ext/extconf.rb
|
|
@@ -283,10 +282,12 @@ files:
|
|
|
283
282
|
- spec/support/fixtures/generated_config.yml
|
|
284
283
|
- spec/support/fixtures/uploaded_file.txt
|
|
285
284
|
- spec/support/helpers/config_helpers.rb
|
|
285
|
+
- spec/support/helpers/directory_helper.rb
|
|
286
286
|
- spec/support/helpers/env_helpers.rb
|
|
287
287
|
- spec/support/helpers/notification_helpers.rb
|
|
288
288
|
- spec/support/helpers/time_helpers.rb
|
|
289
289
|
- spec/support/helpers/transaction_helpers.rb
|
|
290
|
+
- spec/support/helpers/very_specific_error.rb
|
|
290
291
|
- spec/support/mocks/mock_extension.rb
|
|
291
292
|
- spec/support/project_fixture/config/application.rb
|
|
292
293
|
- spec/support/project_fixture/config/appsignal.yml
|
|
@@ -317,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
317
318
|
version: '0'
|
|
318
319
|
requirements: []
|
|
319
320
|
rubyforge_project:
|
|
320
|
-
rubygems_version: 2.
|
|
321
|
+
rubygems_version: 2.5.1
|
|
321
322
|
signing_key:
|
|
322
323
|
specification_version: 4
|
|
323
324
|
summary: Logs performance and exception data from your app to appsignal.com
|
|
@@ -386,10 +387,12 @@ test_files:
|
|
|
386
387
|
- spec/support/fixtures/generated_config.yml
|
|
387
388
|
- spec/support/fixtures/uploaded_file.txt
|
|
388
389
|
- spec/support/helpers/config_helpers.rb
|
|
390
|
+
- spec/support/helpers/directory_helper.rb
|
|
389
391
|
- spec/support/helpers/env_helpers.rb
|
|
390
392
|
- spec/support/helpers/notification_helpers.rb
|
|
391
393
|
- spec/support/helpers/time_helpers.rb
|
|
392
394
|
- spec/support/helpers/transaction_helpers.rb
|
|
395
|
+
- spec/support/helpers/very_specific_error.rb
|
|
393
396
|
- spec/support/mocks/mock_extension.rb
|
|
394
397
|
- spec/support/project_fixture/config/application.rb
|
|
395
398
|
- spec/support/project_fixture/config/appsignal.yml
|
|
@@ -399,4 +402,3 @@ test_files:
|
|
|
399
402
|
- spec/support/project_fixture/log/.gitkeep
|
|
400
403
|
- spec/support/rails/my_app.rb
|
|
401
404
|
- spec/support/stubs/delayed_job.rb
|
|
402
|
-
has_rdoc:
|