appsignal 1.4.0.beta.1 → 2.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -565,7 +565,9 @@ describe Appsignal do
565
565
  )
566
566
  end
567
567
  around do |example|
568
- capture_stdout(out_stream) { example.run }
568
+ recognize_as_container(:none) do
569
+ capture_stdout(out_stream) { example.run }
570
+ end
569
571
  end
570
572
  after { FileUtils.rm_rf(log_path) }
571
573
 
@@ -601,11 +603,14 @@ describe Appsignal do
601
603
  expect(out_stream.string).to include 'Log to not writable log file'
602
604
  end
603
605
 
606
+ it "amends in memory log to stdout" do
607
+ expect(out_stream.string).to include 'Log in memory'
608
+ end
609
+
604
610
  it "outputs a warning" do
605
- output = out_stream.string
606
- expect(output).to include "appsignal: Unable to start logger with "\
607
- "log path '#{log_file}'."
608
- expect(output).to include "appsignal: Permission denied"
611
+ expect(out_stream.string).to include \
612
+ "appsignal: Unable to start logger with log path '#{log_file}'.",
613
+ "appsignal: Permission denied"
609
614
  end
610
615
  end
611
616
  end
@@ -626,6 +631,12 @@ describe Appsignal do
626
631
  it "amends in memory log to stdout" do
627
632
  expect(out_stream.string).to include 'Log in memory'
628
633
  end
634
+
635
+ it "outputs a warning" do
636
+ expect(out_stream.string).to include \
637
+ "appsignal: Unable to log to '#{log_path}' "\
638
+ "or the '#{Appsignal::Config::SYSTEM_TMP_DIR}' fallback."
639
+ end
629
640
  end
630
641
 
631
642
  context "when on Heroku" do
@@ -635,8 +646,8 @@ describe Appsignal do
635
646
  end
636
647
  around { |example| recognize_as_heroku { example.run } }
637
648
 
638
- it "should log to stdout" do
639
- out_stream.string.should include 'appsignal: Log to stdout'
649
+ it "logs to stdout" do
650
+ expect(out_stream.string).to include 'appsignal: Log to stdout'
640
651
  end
641
652
 
642
653
  it "amends in memory log to stdout" do
@@ -0,0 +1,17 @@
1
+ module CLIHelpers
2
+ def cli
3
+ Appsignal::CLI
4
+ end
5
+
6
+ def run_cli(command, options = {})
7
+ cli.run(format_cli_arguments_and_options(command, options))
8
+ end
9
+
10
+ def format_cli_arguments_and_options(command, options = {})
11
+ [*command].tap do |o|
12
+ options.each do |key, value|
13
+ o << "--#{key}=#{value}"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,7 +1,8 @@
1
1
  module EnvHelpers
2
2
  def http_request_env_with_data(args={})
3
+ path = args.delete(:path) || "/blog"
3
4
  Rack::MockRequest.env_for(
4
- '/blog',
5
+ path,
5
6
  :params => {
6
7
  'controller' => 'blog_posts',
7
8
  'action' => 'show',
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.4.0.beta.1
4
+ version: 2.0.0.beta.1
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-10-07 00:00:00.000000000 Z
12
+ date: 2016-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -198,7 +198,6 @@ files:
198
198
  - lib/appsignal/js_exception_transaction.rb
199
199
  - lib/appsignal/marker.rb
200
200
  - lib/appsignal/minutely.rb
201
- - lib/appsignal/params_sanitizer.rb
202
201
  - lib/appsignal/rack/generic_instrumentation.rb
203
202
  - lib/appsignal/rack/js_exception_catcher.rb
204
203
  - lib/appsignal/rack/rails_instrumentation.rb
@@ -212,7 +211,6 @@ files:
212
211
  - lib/appsignal/utils/query_params_sanitizer.rb
213
212
  - lib/appsignal/version.rb
214
213
  - lib/sequel/extensions/appsignal_integration.rb
215
- - lib/tasks/diag.rake
216
214
  - resources/appsignal.yml.erb
217
215
  - resources/cacert.pem
218
216
  - spec/lib/appsignal/auth_check_spec.rb
@@ -287,6 +285,7 @@ files:
287
285
  - spec/support/fixtures/generated_config.yml
288
286
  - spec/support/fixtures/uploaded_file.txt
289
287
  - spec/support/helpers/api_request_helper.rb
288
+ - spec/support/helpers/cli_helpers.rb
290
289
  - spec/support/helpers/config_helpers.rb
291
290
  - spec/support/helpers/dependency_helper.rb
292
291
  - spec/support/helpers/directory_helper.rb
@@ -327,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
326
  version: 1.3.1
328
327
  requirements: []
329
328
  rubyforge_project:
330
- rubygems_version: 2.4.5
329
+ rubygems_version: 2.5.1
331
330
  signing_key:
332
331
  specification_version: 4
333
332
  summary: Logs performance and exception data from your app to appsignal.com
@@ -404,6 +403,7 @@ test_files:
404
403
  - spec/support/fixtures/generated_config.yml
405
404
  - spec/support/fixtures/uploaded_file.txt
406
405
  - spec/support/helpers/api_request_helper.rb
406
+ - spec/support/helpers/cli_helpers.rb
407
407
  - spec/support/helpers/config_helpers.rb
408
408
  - spec/support/helpers/dependency_helper.rb
409
409
  - spec/support/helpers/directory_helper.rb
@@ -423,4 +423,3 @@ test_files:
423
423
  - spec/support/project_fixture/log/.gitkeep
424
424
  - spec/support/rails/my_app.rb
425
425
  - spec/support/stubs/delayed_job.rb
426
- has_rdoc:
@@ -1,13 +0,0 @@
1
- module Appsignal
2
- class ParamsSanitizer
3
- class << self
4
- extend Gem::Deprecate
5
-
6
- def sanitize(params)
7
- Appsignal::Utils::ParamsSanitizer.sanitize(params)
8
- end
9
-
10
- deprecate :sanitize, "AppSignal::Utils::ParamsSanitizer.sanitize", 2016, 9
11
- end
12
- end
13
- end
@@ -1,79 +0,0 @@
1
- require 'appsignal'
2
-
3
- namespace :appsignal do
4
- namespace :diag do
5
-
6
- desc "Shows the AppSignal gem version"
7
- task :gem_version do
8
- puts "Gem version: #{Appsignal::VERSION}"
9
- end
10
-
11
- desc "Shows the agent version"
12
- task :agent_version do
13
- puts "Agent version: #{Appsignal::Extension.agent_version}"
14
- end
15
-
16
- desc "Attempt to start appsignal"
17
- task :start_appsignal do
18
- Appsignal.start
19
- end
20
-
21
- desc "Checks if config is present and shows the values"
22
- task :config => :start_appsignal do
23
- if Appsignal.config && Appsignal.config.config_hash
24
- Appsignal.config.config_hash.each do |key, val|
25
- puts "Config #{key}: #{val}"
26
- end
27
- else
28
- puts "No config present"
29
- end
30
- end
31
-
32
- desc "Checks if required paths are writeable"
33
- task :paths_writable => :start_appsignal do
34
- possible_paths = [
35
- Appsignal.config.root_path,
36
- Appsignal.config.log_file_path
37
- ]
38
-
39
- puts "Checking if required paths are writable:"
40
- possible_paths.each do |path|
41
- result = File.writable?(path) ? 'Ok' : 'Failed'
42
- puts "#{path} ...#{result}"
43
- end
44
- puts "\n"
45
- end
46
-
47
- desc "Check if API key is valid"
48
- task :check_api_key => :start_appsignal do
49
- auth_check = ::Appsignal::AuthCheck.new(Appsignal.config, Appsignal.logger)
50
- status, result = auth_check.perform_with_result
51
- if status == '200'
52
- puts "Checking API key: Ok"
53
- else
54
- puts "Checking API key: Failed"
55
- end
56
- end
57
-
58
- desc "Check the ext installation log"
59
- task :check_ext_install do
60
- require 'bundler/cli'
61
- require "bundler/cli/common"
62
- path = Bundler::CLI::Common.select_spec('appsignal').full_gem_path
63
- log_path = "#{path.strip}/ext/install.log"
64
- puts "Showing last lines of extension install log: #{log_path}"
65
- puts File.read(log_path)
66
- puts "\n"
67
- end
68
-
69
- task :run => [
70
- "diag:gem_version",
71
- "diag:agent_version",
72
- "diag:start_appsignal",
73
- "diag:config",
74
- "diag:check_api_key",
75
- "diag:paths_writable",
76
- "diag:check_ext_install"
77
- ]
78
- end
79
- end