appsignal 2.1.0.beta.1 → 2.1.0
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 +2 -1
- data/CHANGELOG.md +5 -0
- data/README.md +14 -15
- data/appsignal.gemspec +1 -1
- data/lib/appsignal.rb +1 -1
- data/lib/appsignal/auth_check.rb +5 -2
- data/lib/appsignal/cli/demo.rb +1 -1
- data/lib/appsignal/cli/diagnose.rb +1 -1
- data/lib/appsignal/cli/install.rb +1 -1
- data/lib/appsignal/transaction.rb +2 -1
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/auth_check_spec.rb +9 -10
- data/spec/lib/appsignal/capistrano2_spec.rb +6 -6
- data/spec/lib/appsignal/capistrano3_spec.rb +6 -6
- data/spec/lib/appsignal/cli/demo_spec.rb +1 -1
- data/spec/lib/appsignal/cli/diagnose_spec.rb +1 -1
- data/spec/lib/appsignal/cli/helpers_spec.rb +2 -2
- data/spec/lib/appsignal/cli/install_spec.rb +2 -2
- data/spec/lib/appsignal/cli_spec.rb +2 -2
- data/spec/lib/appsignal/config_spec.rb +24 -24
- data/spec/lib/appsignal/demo_spec.rb +4 -2
- data/spec/lib/appsignal/event_formatter/action_view/render_formatter_spec.rb +11 -7
- data/spec/lib/appsignal/event_formatter/active_record/instantiation_formatter_spec.rb +2 -2
- data/spec/lib/appsignal/event_formatter/active_record/sql_formatter_spec.rb +2 -2
- data/spec/lib/appsignal/event_formatter/elastic_search/search_formatter_spec.rb +1 -1
- data/spec/lib/appsignal/event_formatter/faraday/request_formatter_spec.rb +2 -2
- data/spec/lib/appsignal/event_formatter/moped/query_formatter_spec.rb +9 -9
- data/spec/lib/appsignal/event_formatter_spec.rb +17 -17
- data/spec/lib/appsignal/extension_spec.rb +7 -7
- data/spec/lib/appsignal/garbage_collection_profiler_spec.rb +0 -3
- data/spec/lib/appsignal/hooks/active_support_notifications_spec.rb +11 -3
- data/spec/lib/appsignal/hooks/celluloid_spec.rb +12 -4
- data/spec/lib/appsignal/hooks/data_mapper_spec.rb +12 -4
- data/spec/lib/appsignal/hooks/delayed_job_spec.rb +21 -13
- data/spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb +14 -6
- data/spec/lib/appsignal/hooks/net_http_spec.rb +11 -3
- data/spec/lib/appsignal/hooks/passenger_spec.rb +14 -6
- data/spec/lib/appsignal/hooks/puma_spec.rb +18 -10
- data/spec/lib/appsignal/hooks/rake_spec.rb +2 -2
- data/spec/lib/appsignal/hooks/redis_spec.rb +40 -30
- data/spec/lib/appsignal/hooks/sequel_spec.rb +11 -3
- data/spec/lib/appsignal/hooks/shoryuken_spec.rb +15 -7
- data/spec/lib/appsignal/hooks/sidekiq_spec.rb +17 -9
- data/spec/lib/appsignal/hooks/unicorn_spec.rb +16 -8
- data/spec/lib/appsignal/hooks/webmachine_spec.rb +14 -4
- data/spec/lib/appsignal/hooks_spec.rb +28 -28
- data/spec/lib/appsignal/integrations/data_mapper_spec.rb +1 -1
- data/spec/lib/appsignal/integrations/grape_spec.rb +3 -3
- data/spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb +14 -16
- data/spec/lib/appsignal/integrations/object_spec.rb +10 -10
- data/spec/lib/appsignal/integrations/padrino_spec.rb +14 -18
- data/spec/lib/appsignal/integrations/railtie_spec.rb +35 -19
- data/spec/lib/appsignal/integrations/resque_active_job_spec.rb +2 -2
- data/spec/lib/appsignal/integrations/resque_spec.rb +8 -8
- data/spec/lib/appsignal/integrations/sinatra_spec.rb +2 -2
- data/spec/lib/appsignal/integrations/webmachine_spec.rb +1 -1
- data/spec/lib/appsignal/js_exception_transaction_spec.rb +1 -1
- data/spec/lib/appsignal/minutely_spec.rb +3 -3
- data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +12 -12
- data/spec/lib/appsignal/rack/js_exception_catcher_spec.rb +2 -2
- data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +19 -15
- data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +21 -21
- data/spec/lib/appsignal/rack/streaming_listener_spec.rb +5 -5
- data/spec/lib/appsignal/system_spec.rb +5 -5
- data/spec/lib/appsignal/transaction_spec.rb +176 -155
- data/spec/lib/appsignal/transmitter_spec.rb +29 -23
- data/spec/lib/appsignal/utils/params_sanitizer_spec.rb +49 -35
- data/spec/lib/appsignal/utils_spec.rb +15 -8
- data/spec/lib/appsignal_spec.rb +134 -150
- data/spec/spec_helper.rb +5 -2
- metadata +6 -10
- data/spec/lib/tmp/config/appsignal.yml +0 -2
- data/spec/support/delegate_matcher.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c21c84f210750178cad52383cb8945c759e3ef7
|
4
|
+
data.tar.gz: bd2d8b11d9f0dca396b846f5cfcad4cd834b7adc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a7d8cfc7c177f158b0da831dd35ce72efccd0f6ebfff7fd36a9ac6053a906db0959c49b6eb6a13ac72da855d4e0344095100c5597daa4e286e2004c047b41b6
|
7
|
+
data.tar.gz: af5c20d7e786bdd702008f942c951da08bfe8d196f2d12b44eac04c51c0a3ebbc85850bafe6c13a6fc8ef78b83ec086adda7d4dfb0c71e531a9d20a7c74cd07f
|
data/.rspec
CHANGED
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,11 @@
|
|
5
5
|
* Deprecate `Appsignal.is_ignored_error?`. PR #224
|
6
6
|
* Deprecate `Appsignal.is_ignored_action?`. PR #224
|
7
7
|
* Enforce a coding styleguide with RuboCop. PR #226
|
8
|
+
* Remove unused `Appsignal.agent` attribute. PR #244
|
9
|
+
* Deprecate unused `Appsignal::AuthCheck` logger argument. PR #245
|
10
|
+
|
11
|
+
# 2.0.6
|
12
|
+
* Fix `Appsignal::Transaction#record_event` method call. PR #240
|
8
13
|
|
9
14
|
# 2.0.5
|
10
15
|
* Improved logging for agent connection issues.
|
data/README.md
CHANGED
@@ -113,8 +113,8 @@ appsignal install [push api key]
|
|
113
113
|
```
|
114
114
|
|
115
115
|
Depending on what framework or gems you use some manual integration is
|
116
|
-
required. Follow the steps in the wizard or consult our [
|
117
|
-
|
116
|
+
required. Follow the steps in the wizard or consult our [integrations] page for
|
117
|
+
help.
|
118
118
|
|
119
119
|
If you're stuck feel free to [contact us][contact]!
|
120
120
|
|
@@ -139,8 +139,8 @@ AppSignal instrumentation doesn't depend on automatic integrations. It's easy
|
|
139
139
|
to set up [custom instrumentation][custom-instrumentation] to add keep track of
|
140
140
|
anything.
|
141
141
|
|
142
|
-
For more detailed information and examples please visit our
|
143
|
-
|
142
|
+
For more detailed information and examples please visit our
|
143
|
+
[integrations] page.
|
144
144
|
|
145
145
|
### Front-end monitoring (Beta)
|
146
146
|
|
@@ -150,8 +150,7 @@ currently. Be sure to check it out!
|
|
150
150
|
## Supported systems
|
151
151
|
|
152
152
|
Currently the AppSignal agent works on most Unix-like operating systems, such
|
153
|
-
as most Linux distributions and macOS, excluding
|
154
|
-
Windows.
|
153
|
+
as most Linux distributions and macOS, excluding FreeBSD and Windows.
|
155
154
|
|
156
155
|
For more detailed information please visit our [Supported
|
157
156
|
systems][supported-systems] page.
|
@@ -229,15 +228,15 @@ the most out of using AppSignal.
|
|
229
228
|
[contact]: mailto:support@appsignal.com
|
230
229
|
[waffles-page]: https://appsignal.com/waffles
|
231
230
|
[docs]: http://docs.appsignal.com
|
232
|
-
[contributing-guide]: http://docs.appsignal.com/contributing
|
233
|
-
[supported-systems]: http://docs.appsignal.com/
|
234
|
-
[
|
235
|
-
[custom-instrumentation]: http://docs.appsignal.com/
|
236
|
-
[front-end-monitoring]: http://docs.appsignal.com/
|
237
|
-
[exception-handling]: http://docs.appsignal.com/
|
238
|
-
[tagging]: http://docs.appsignal.com/
|
239
|
-
[host-metrics]: http://docs.appsignal.com/
|
240
|
-
[custom-metrics]: http://docs.appsignal.com/
|
231
|
+
[contributing-guide]: http://docs.appsignal.com/appsignal/contributing.html
|
232
|
+
[supported-systems]: http://docs.appsignal.com/support/operating-systems.html
|
233
|
+
[integrations]: http://docs.appsignal.com/ruby/integrations/index.html
|
234
|
+
[custom-instrumentation]: http://docs.appsignal.com/ruby/instrumentation/
|
235
|
+
[front-end-monitoring]: http://docs.appsignal.com/front-end/error-handling.html
|
236
|
+
[exception-handling]: http://docs.appsignal.com/ruby/instrumentation/exception-handling.html
|
237
|
+
[tagging]: http://docs.appsignal.com/ruby/instrumentation/tagging.html
|
238
|
+
[host-metrics]: http://docs.appsignal.com/metrics/host.html
|
239
|
+
[custom-metrics]: http://docs.appsignal.com/metrics/custom.html
|
241
240
|
|
242
241
|
[semver]: http://semver.org/
|
243
242
|
[rvm]: http://rvm.io/
|
data/appsignal.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |gem|
|
|
27
27
|
gem.add_dependency 'thread_safe'
|
28
28
|
|
29
29
|
gem.add_development_dependency 'rake', '~> 11'
|
30
|
-
gem.add_development_dependency 'rspec', '~>
|
30
|
+
gem.add_development_dependency 'rspec', '~> 3.5'
|
31
31
|
gem.add_development_dependency 'pry'
|
32
32
|
gem.add_development_dependency 'timecop'
|
33
33
|
gem.add_development_dependency 'webmock'
|
data/lib/appsignal.rb
CHANGED
data/lib/appsignal/auth_check.rb
CHANGED
@@ -4,9 +4,12 @@ module Appsignal
|
|
4
4
|
|
5
5
|
attr_reader :config, :logger
|
6
6
|
|
7
|
-
def initialize(config, logger =
|
7
|
+
def initialize(config, logger = nil)
|
8
8
|
@config = config
|
9
|
-
|
9
|
+
if logger # rubocop:disable Style/GuardClause
|
10
|
+
warn "Deprecated: `logger` argument will be removed in the next " \
|
11
|
+
"major version."
|
12
|
+
end
|
10
13
|
end
|
11
14
|
|
12
15
|
def perform
|
data/lib/appsignal/cli/demo.rb
CHANGED
@@ -10,7 +10,7 @@ module Appsignal
|
|
10
10
|
puts "Sending demonstration sample data..."
|
11
11
|
if Appsignal::Demo.transmit
|
12
12
|
puts "Demonstration sample data sent!"
|
13
|
-
puts "It may take about a minute for the data to appear on
|
13
|
+
puts "It may take about a minute for the data to appear on https://appsignal.com/accounts"
|
14
14
|
else
|
15
15
|
puts "Error: Unable to start the AppSignal agent and send data to AppSignal.com"
|
16
16
|
puts "Please use `appsignal diagnose` to debug your configuration."
|
@@ -159,7 +159,7 @@ module Appsignal
|
|
159
159
|
end
|
160
160
|
|
161
161
|
def check_api_key
|
162
|
-
auth_check = ::Appsignal::AuthCheck.new(Appsignal.config
|
162
|
+
auth_check = ::Appsignal::AuthCheck.new(Appsignal.config)
|
163
163
|
print "Validating API key: "
|
164
164
|
status, error = auth_check.perform_with_result
|
165
165
|
case status
|
@@ -204,7 +204,7 @@ module Appsignal
|
|
204
204
|
puts " Sending example data to AppSignal..."
|
205
205
|
if Appsignal::Demo.transmit
|
206
206
|
puts " Example data sent!"
|
207
|
-
puts " It may take about a minute for the data to appear on
|
207
|
+
puts " It may take about a minute for the data to appear on https://appsignal.com/accounts"
|
208
208
|
puts
|
209
209
|
puts " Please return to your browser and follow the instructions."
|
210
210
|
else
|
@@ -215,7 +215,8 @@ module Appsignal
|
|
215
215
|
title || BLANK,
|
216
216
|
body || BLANK,
|
217
217
|
duration,
|
218
|
-
body_format || Appsignal::EventFormatter::DEFAULT
|
218
|
+
body_format || Appsignal::EventFormatter::DEFAULT,
|
219
|
+
self.class.garbage_collection_profiler.total_time
|
219
220
|
)
|
220
221
|
end
|
221
222
|
|
data/lib/appsignal/version.rb
CHANGED
@@ -1,29 +1,28 @@
|
|
1
1
|
describe Appsignal::AuthCheck do
|
2
2
|
let(:config) { project_fixture_config }
|
3
|
-
let(:
|
4
|
-
let(:auth_check) { Appsignal::AuthCheck.new(config, logger) }
|
3
|
+
let(:auth_check) { Appsignal::AuthCheck.new(config) }
|
5
4
|
|
6
5
|
describe "#perform_with_result" do
|
7
6
|
it "should give success message" do
|
8
|
-
auth_check.
|
9
|
-
auth_check.perform_with_result.
|
7
|
+
expect(auth_check).to receive(:perform).and_return("200")
|
8
|
+
expect(auth_check.perform_with_result).to eq ["200", "AppSignal has confirmed authorization!"]
|
10
9
|
end
|
11
10
|
|
12
11
|
it "should give 401 message" do
|
13
|
-
auth_check.
|
14
|
-
auth_check.perform_with_result.
|
12
|
+
expect(auth_check).to receive(:perform).and_return("401")
|
13
|
+
expect(auth_check.perform_with_result).to eq ["401", "API key not valid with AppSignal..."]
|
15
14
|
end
|
16
15
|
|
17
16
|
it "should give an error message" do
|
18
|
-
auth_check.
|
19
|
-
auth_check.perform_with_result.
|
17
|
+
expect(auth_check).to receive(:perform).and_return("402")
|
18
|
+
expect(auth_check.perform_with_result).to eq ["402", "Could not confirm authorization: 402"]
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
23
22
|
context "transmitting" do
|
24
23
|
before do
|
25
24
|
@transmitter = double
|
26
|
-
Appsignal::Transmitter.
|
25
|
+
expect(Appsignal::Transmitter).to receive(:new).with(
|
27
26
|
"auth",
|
28
27
|
kind_of(Appsignal::Config)
|
29
28
|
).and_return(@transmitter)
|
@@ -31,7 +30,7 @@ describe Appsignal::AuthCheck do
|
|
31
30
|
|
32
31
|
describe "#perform" do
|
33
32
|
it "should not transmit any extra data" do
|
34
|
-
@transmitter.
|
33
|
+
expect(@transmitter).to receive(:transmit).with({}).and_return({})
|
35
34
|
auth_check.perform
|
36
35
|
end
|
37
36
|
end
|
@@ -26,7 +26,7 @@ if DependencyHelper.capistrano2_present?
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should have a deploy task" do
|
29
|
-
capistrano_config.find_task("appsignal:deploy").
|
29
|
+
expect(capistrano_config.find_task("appsignal:deploy")).to_not be_nil
|
30
30
|
end
|
31
31
|
|
32
32
|
describe "appsignal:deploy task" do
|
@@ -41,7 +41,7 @@ if DependencyHelper.capistrano2_present?
|
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should be instantiated with the right params" do
|
44
|
-
Appsignal::Config.
|
44
|
+
expect(Appsignal::Config).to receive(:new).with(
|
45
45
|
project_fixture_path,
|
46
46
|
"production",
|
47
47
|
{},
|
@@ -55,7 +55,7 @@ if DependencyHelper.capistrano2_present?
|
|
55
55
|
end
|
56
56
|
|
57
57
|
it "should be instantiated with the right params" do
|
58
|
-
Appsignal::Config.
|
58
|
+
expect(Appsignal::Config).to receive(:new).with(
|
59
59
|
project_fixture_path,
|
60
60
|
"production",
|
61
61
|
{ :name => "AppName" },
|
@@ -70,7 +70,7 @@ if DependencyHelper.capistrano2_present?
|
|
70
70
|
end
|
71
71
|
|
72
72
|
it "should be instantiated with the right params" do
|
73
|
-
Appsignal::Config.
|
73
|
+
expect(Appsignal::Config).to receive(:new).with(
|
74
74
|
project_fixture_path,
|
75
75
|
"rack_production",
|
76
76
|
{ :name => "AppName" },
|
@@ -86,7 +86,7 @@ if DependencyHelper.capistrano2_present?
|
|
86
86
|
end
|
87
87
|
|
88
88
|
it "should be instantiated with the right params" do
|
89
|
-
Appsignal::Config.
|
89
|
+
expect(Appsignal::Config).to receive(:new).with(
|
90
90
|
project_fixture_path,
|
91
91
|
"stage_production",
|
92
92
|
{ :name => "AppName" },
|
@@ -103,7 +103,7 @@ if DependencyHelper.capistrano2_present?
|
|
103
103
|
end
|
104
104
|
|
105
105
|
it "should prefer the appsignal_env rather than stage, rails_env and rack_env" do
|
106
|
-
Appsignal::Config.
|
106
|
+
expect(Appsignal::Config).to receive(:new).with(
|
107
107
|
project_fixture_path,
|
108
108
|
"appsignal_production",
|
109
109
|
{ :name => "AppName" },
|
@@ -30,7 +30,7 @@ if DependencyHelper.capistrano3_present?
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should have a deploy task" do
|
33
|
-
Rake::Task.task_defined?("appsignal:deploy").
|
33
|
+
expect(Rake::Task.task_defined?("appsignal:deploy")).to be_truthy
|
34
34
|
end
|
35
35
|
|
36
36
|
describe "appsignal:deploy task" do
|
@@ -41,7 +41,7 @@ if DependencyHelper.capistrano3_present?
|
|
41
41
|
|
42
42
|
context "config" do
|
43
43
|
it "should be instantiated with the right params" do
|
44
|
-
Appsignal::Config.
|
44
|
+
expect(Appsignal::Config).to receive(:new).with(
|
45
45
|
project_fixture_path,
|
46
46
|
"production",
|
47
47
|
{},
|
@@ -55,7 +55,7 @@ if DependencyHelper.capistrano3_present?
|
|
55
55
|
end
|
56
56
|
|
57
57
|
it "should be instantiated with the right params" do
|
58
|
-
Appsignal::Config.
|
58
|
+
expect(Appsignal::Config).to receive(:new).with(
|
59
59
|
project_fixture_path,
|
60
60
|
"production",
|
61
61
|
{ :name => "AppName" },
|
@@ -70,7 +70,7 @@ if DependencyHelper.capistrano3_present?
|
|
70
70
|
end
|
71
71
|
|
72
72
|
it "should be instantiated with the rack env" do
|
73
|
-
Appsignal::Config.
|
73
|
+
expect(Appsignal::Config).to receive(:new).with(
|
74
74
|
project_fixture_path,
|
75
75
|
"rack_production",
|
76
76
|
{ :name => "AppName" },
|
@@ -86,7 +86,7 @@ if DependencyHelper.capistrano3_present?
|
|
86
86
|
end
|
87
87
|
|
88
88
|
it "should prefer the stage rather than rails_env and rack_env" do
|
89
|
-
Appsignal::Config.
|
89
|
+
expect(Appsignal::Config).to receive(:new).with(
|
90
90
|
project_fixture_path,
|
91
91
|
"stage_production",
|
92
92
|
{ :name => "AppName" },
|
@@ -103,7 +103,7 @@ if DependencyHelper.capistrano3_present?
|
|
103
103
|
end
|
104
104
|
|
105
105
|
it "should prefer the appsignal_env rather than stage, rails_env and rack_env" do
|
106
|
-
Appsignal::Config.
|
106
|
+
expect(Appsignal::Config).to receive(:new).with(
|
107
107
|
project_fixture_path,
|
108
108
|
"appsignal_production",
|
109
109
|
{ :name => "AppName" },
|
@@ -6,7 +6,7 @@ describe Appsignal::CLI::Demo do
|
|
6
6
|
let(:options) { {} }
|
7
7
|
let(:out_stream) { std_stream }
|
8
8
|
let(:output) { out_stream.read }
|
9
|
-
before(:
|
9
|
+
before(:context) { Appsignal.stop }
|
10
10
|
before do
|
11
11
|
ENV.delete("APPSIGNAL_APP_ENV")
|
12
12
|
ENV.delete("RAILS_ENV")
|
@@ -7,7 +7,7 @@ describe Appsignal::CLI::Diagnose, :api_stub => true do
|
|
7
7
|
let(:config) { project_fixture_config }
|
8
8
|
let(:cli) { described_class }
|
9
9
|
let(:options) { { :environment => config.env } }
|
10
|
-
before(:
|
10
|
+
before(:context) { Appsignal.stop }
|
11
11
|
before do
|
12
12
|
if DependencyHelper.rails_present?
|
13
13
|
allow(Rails).to receive(:root).and_return(Pathname.new(config.root_path))
|
@@ -70,7 +70,7 @@ describe Appsignal::CLI::Helpers do
|
|
70
70
|
set_input "y"
|
71
71
|
prepare_input
|
72
72
|
|
73
|
-
expect(yes_or_no).to
|
73
|
+
expect(yes_or_no).to be_truthy
|
74
74
|
end
|
75
75
|
|
76
76
|
it "takes no for an answer" do
|
@@ -79,7 +79,7 @@ describe Appsignal::CLI::Helpers do
|
|
79
79
|
set_input "n"
|
80
80
|
prepare_input
|
81
81
|
|
82
|
-
expect(yes_or_no).to
|
82
|
+
expect(yes_or_no).to be_falsy
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
@@ -173,7 +173,7 @@ describe Appsignal::CLI::Install do
|
|
173
173
|
run
|
174
174
|
|
175
175
|
expect(output).to_not include "Adding AppSignal integration to Capfile"
|
176
|
-
expect(File.exist?(capfile)).to
|
176
|
+
expect(File.exist?(capfile)).to be_falsy
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
@@ -622,7 +622,7 @@ describe Appsignal::CLI::Install do
|
|
622
622
|
expect(output).to include "We could not detect which framework you are using."
|
623
623
|
expect(output).to_not include_env_push_api_key
|
624
624
|
expect(output).to_not include_env_app_name
|
625
|
-
expect(File.exist?(config_file_path)).to
|
625
|
+
expect(File.exist?(config_file_path)).to be_falsy
|
626
626
|
end
|
627
627
|
end
|
628
628
|
end
|
@@ -4,7 +4,7 @@ describe Appsignal::CLI do
|
|
4
4
|
let(:out_stream) { std_stream }
|
5
5
|
let(:output) { out_stream.read }
|
6
6
|
let(:cli) { Appsignal::CLI }
|
7
|
-
before { Dir.
|
7
|
+
before { allow(Dir).to receive(:pwd).and_return(project_fixture_path) }
|
8
8
|
|
9
9
|
it "should print the help with no arguments, -h and --help" do
|
10
10
|
[nil, "-h", "--help"].each do |arg|
|
@@ -46,7 +46,7 @@ describe Appsignal::CLI do
|
|
46
46
|
|
47
47
|
describe "diagnose" do
|
48
48
|
it "should call Appsignal::Diagnose.install" do
|
49
|
-
Appsignal::CLI::Diagnose.
|
49
|
+
expect(Appsignal::CLI::Diagnose).to receive(:run)
|
50
50
|
|
51
51
|
cli.run([
|
52
52
|
"diagnose"
|
@@ -39,13 +39,13 @@ describe Appsignal::Config do
|
|
39
39
|
before { ENV["APPSIGNAL_PUSH_API_KEY"] = "abc" }
|
40
40
|
|
41
41
|
it "becomes active" do
|
42
|
-
expect(subject).to
|
42
|
+
expect(subject).to be_truthy
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
context "without APPSIGNAL_PUSH_API_KEY env variable" do
|
47
47
|
it "remains inactive" do
|
48
|
-
expect(subject).to
|
48
|
+
expect(subject).to be_falsy
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -57,7 +57,7 @@ describe Appsignal::Config do
|
|
57
57
|
around { |example| recognize_as_heroku { example.run } }
|
58
58
|
|
59
59
|
it "is set to true" do
|
60
|
-
expect(subject).to
|
60
|
+
expect(subject).to be_truthy
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -65,7 +65,7 @@ describe Appsignal::Config do
|
|
65
65
|
around { |example| recognize_as_container(:docker) { example.run } }
|
66
66
|
|
67
67
|
it "is set to true" do
|
68
|
-
expect(subject).to
|
68
|
+
expect(subject).to be_truthy
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -73,7 +73,7 @@ describe Appsignal::Config do
|
|
73
73
|
around { |example| recognize_as_container(:none) { example.run } }
|
74
74
|
|
75
75
|
it "is set to false" do
|
76
|
-
expect(subject).to
|
76
|
+
expect(subject).to be_falsy
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
@@ -151,7 +151,7 @@ describe Appsignal::Config do
|
|
151
151
|
subject { config[:running_in_container] }
|
152
152
|
|
153
153
|
it "overrides system detected config" do
|
154
|
-
expect(subject).to
|
154
|
+
expect(subject).to be_truthy
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
@@ -169,7 +169,7 @@ describe Appsignal::Config do
|
|
169
169
|
before { ENV["APPSIGNAL_PUSH_API_KEY"] = "abc" }
|
170
170
|
|
171
171
|
it "sets given config rather than env variable" do
|
172
|
-
expect(subject).to
|
172
|
+
expect(subject).to be_falsy
|
173
173
|
end
|
174
174
|
end
|
175
175
|
end
|
@@ -180,8 +180,8 @@ describe Appsignal::Config do
|
|
180
180
|
let(:config) { described_class.new(nil, "production") }
|
181
181
|
|
182
182
|
it "is not valid or active" do
|
183
|
-
expect(config.valid?).to
|
184
|
-
expect(config.active?).to
|
183
|
+
expect(config.valid?).to be_falsy
|
184
|
+
expect(config.active?).to be_falsy
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
@@ -189,8 +189,8 @@ describe Appsignal::Config do
|
|
189
189
|
let(:config) { described_class.new(tmp_dir, "production") }
|
190
190
|
|
191
191
|
it "is not valid or active" do
|
192
|
-
expect(config.valid?).to
|
193
|
-
expect(config.active?).to
|
192
|
+
expect(config.valid?).to be_falsy
|
193
|
+
expect(config.active?).to be_falsy
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
@@ -198,8 +198,8 @@ describe Appsignal::Config do
|
|
198
198
|
let(:config) { project_fixture_config("production") }
|
199
199
|
|
200
200
|
it "is not valid or active" do
|
201
|
-
expect(config.valid?).to
|
202
|
-
expect(config.active?).to
|
201
|
+
expect(config.valid?).to be_truthy
|
202
|
+
expect(config.active?).to be_truthy
|
203
203
|
end
|
204
204
|
|
205
205
|
it "does not log an error" do
|
@@ -219,8 +219,8 @@ describe Appsignal::Config do
|
|
219
219
|
around { |example| recognize_as_container(:none) { example.run } }
|
220
220
|
|
221
221
|
it "overrides system detected and defaults config" do
|
222
|
-
expect(config[:running_in_container]).to
|
223
|
-
expect(config[:debug]).to
|
222
|
+
expect(config[:running_in_container]).to be_truthy
|
223
|
+
expect(config[:debug]).to be_truthy
|
224
224
|
end
|
225
225
|
end
|
226
226
|
|
@@ -228,8 +228,8 @@ describe Appsignal::Config do
|
|
228
228
|
let(:config) { project_fixture_config(:production) }
|
229
229
|
|
230
230
|
it "loads the config" do
|
231
|
-
expect(config.valid?).to
|
232
|
-
expect(config.active?).to
|
231
|
+
expect(config.valid?).to be_truthy
|
232
|
+
expect(config.active?).to be_truthy
|
233
233
|
|
234
234
|
expect(config[:push_api_key]).to eq("abc")
|
235
235
|
end
|
@@ -239,8 +239,8 @@ describe Appsignal::Config do
|
|
239
239
|
let(:config) { project_fixture_config("nonsense") }
|
240
240
|
|
241
241
|
it "is not valid or active" do
|
242
|
-
expect(config.valid?).to
|
243
|
-
expect(config.active?).to
|
242
|
+
expect(config.valid?).to be_falsy
|
243
|
+
expect(config.active?).to be_falsy
|
244
244
|
end
|
245
245
|
|
246
246
|
it "logs an error" do
|
@@ -315,14 +315,14 @@ describe Appsignal::Config do
|
|
315
315
|
around { |example| recognize_as_container(:none) { example.run } }
|
316
316
|
|
317
317
|
it "overrides config with environment values" do
|
318
|
-
expect(config.valid?).to
|
319
|
-
expect(config.active?).to
|
318
|
+
expect(config.valid?).to be_truthy
|
319
|
+
expect(config.active?).to be_truthy
|
320
320
|
|
321
|
-
expect(config[:running_in_container]).to
|
321
|
+
expect(config[:running_in_container]).to be_truthy
|
322
322
|
expect(config[:push_api_key]).to eq "aaa-bbb-ccc"
|
323
|
-
expect(config[:active]).to
|
323
|
+
expect(config[:active]).to be_truthy
|
324
324
|
expect(config[:name]).to eq "App name"
|
325
|
-
expect(config[:debug]).to
|
325
|
+
expect(config[:debug]).to be_truthy
|
326
326
|
expect(config[:ignore_actions]).to eq ["action1", "action2"]
|
327
327
|
end
|
328
328
|
end
|