bugsnag 6.12.2 → 6.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.buildkite/pipeline.yml +470 -0
  3. data/.rubocop_todo.yml +1 -1
  4. data/CHANGELOG.md +12 -0
  5. data/CONTRIBUTING.md +1 -9
  6. data/Gemfile +11 -6
  7. data/TESTING.md +81 -0
  8. data/VERSION +1 -1
  9. data/docker-compose.yml +46 -0
  10. data/dockerfiles/Dockerfile.jruby-unit-tests +13 -0
  11. data/dockerfiles/Dockerfile.ruby-maze-runner +26 -0
  12. data/dockerfiles/Dockerfile.ruby-unit-tests +12 -0
  13. data/features/delayed_job.feature +6 -22
  14. data/features/fixtures/delayed_job/Dockerfile +2 -4
  15. data/features/fixtures/delayed_job/app/Gemfile +1 -1
  16. data/features/fixtures/delayed_job/app/Rakefile +18 -0
  17. data/features/fixtures/docker-compose.yml +28 -40
  18. data/features/fixtures/expected_breadcrumbs/active_job.json +9 -0
  19. data/features/fixtures/expected_breadcrumbs/mongo_failed.json +15 -0
  20. data/features/fixtures/expected_breadcrumbs/mongo_filtered_request.json +15 -0
  21. data/features/fixtures/expected_breadcrumbs/mongo_filtered_result.json +15 -0
  22. data/features/fixtures/expected_breadcrumbs/mongo_success.json +14 -0
  23. data/features/fixtures/expected_breadcrumbs/request.json +13 -0
  24. data/features/fixtures/expected_breadcrumbs/sql_with_bindings.json +12 -0
  25. data/features/fixtures/expected_breadcrumbs/sql_without_bindings.json +11 -0
  26. data/features/fixtures/plain/Dockerfile +2 -2
  27. data/features/fixtures/plain/app/app.rb +1 -3
  28. data/features/fixtures/plain/app/delivery/fork_threadpool.rb +3 -1
  29. data/features/fixtures/plain/app/unhandled/{Interrupt.rb → interrupt.rb} +0 -0
  30. data/features/fixtures/rack1/Dockerfile +2 -2
  31. data/features/fixtures/rack2/Dockerfile +2 -2
  32. data/features/fixtures/rails3/Dockerfile +2 -2
  33. data/features/fixtures/rails3/app/Gemfile +4 -0
  34. data/features/fixtures/rails3/app/config/initializers/bugsnag.rb +1 -1
  35. data/features/fixtures/rails4/Dockerfile +2 -5
  36. data/features/fixtures/rails4/app/config/initializers/bugsnag.rb +1 -1
  37. data/features/fixtures/rails5/Dockerfile +2 -2
  38. data/features/fixtures/rails5/app/config/initializers/bugsnag.rb +1 -1
  39. data/features/fixtures/rails6/Dockerfile +2 -2
  40. data/features/fixtures/rails6/app/Gemfile +3 -2
  41. data/features/fixtures/rails6/app/app/controllers/mongo_controller.rb +22 -0
  42. data/features/fixtures/rails6/app/app/models/mongo_model.rb +6 -0
  43. data/features/fixtures/rails6/app/config/environments/development.rb +2 -0
  44. data/features/fixtures/rails6/app/config/environments/production.rb +1 -0
  45. data/features/fixtures/rails6/app/config/environments/rails_env.rb +1 -0
  46. data/features/fixtures/rails6/app/config/environments/test.rb +1 -0
  47. data/features/fixtures/rails6/app/config/initializers/bugsnag.rb +1 -1
  48. data/features/fixtures/rails6/app/config/mongoid.yml +23 -0
  49. data/features/fixtures/rails6/app/config/routes.rb +4 -0
  50. data/features/fixtures/resque/Dockerfile +2 -2
  51. data/features/fixtures/sidekiq/Dockerfile +5 -7
  52. data/features/fixtures/sidekiq/app/Gemfile +2 -1
  53. data/features/fixtures/sidekiq/app/Rakefile.rb +14 -0
  54. data/features/fixtures/sinatra1/Dockerfile +2 -2
  55. data/features/fixtures/sinatra2/Dockerfile +2 -2
  56. data/features/plain_features/add_tab.feature +24 -97
  57. data/features/plain_features/app_type.feature +6 -25
  58. data/features/plain_features/app_version.feature +6 -25
  59. data/features/plain_features/auto_notify.feature +4 -20
  60. data/features/plain_features/delivery.feature +12 -60
  61. data/features/plain_features/exception_data.feature +24 -94
  62. data/features/plain_features/filters.feature +9 -43
  63. data/features/plain_features/handled_errors.feature +16 -78
  64. data/features/plain_features/ignore_classes.feature +5 -23
  65. data/features/plain_features/ignore_report.feature +6 -24
  66. data/features/plain_features/proxies.feature +13 -56
  67. data/features/plain_features/release_stages.feature +9 -40
  68. data/features/plain_features/report_api_key.feature +9 -35
  69. data/features/plain_features/report_severity.feature +8 -35
  70. data/features/plain_features/report_stack_frames.feature +24 -92
  71. data/features/plain_features/report_user.feature +23 -96
  72. data/features/plain_features/unhandled_errors.feature +17 -88
  73. data/features/rails_features/api_key.feature +12 -62
  74. data/features/rails_features/app_type.feature +13 -62
  75. data/features/rails_features/app_version.feature +19 -86
  76. data/features/rails_features/auto_capture_sessions.feature +31 -120
  77. data/features/rails_features/auto_notify.feature +28 -113
  78. data/features/rails_features/before_notify.feature +18 -89
  79. data/features/rails_features/breadcrumbs.feature +40 -147
  80. data/features/rails_features/handled.feature +18 -88
  81. data/features/rails_features/ignore_classes.feature +12 -55
  82. data/features/rails_features/meta_data_filters.feature +6 -34
  83. data/features/rails_features/mongo_breadcrumbs.feature +22 -105
  84. data/features/rails_features/project_root.feature +19 -90
  85. data/features/rails_features/release_stage.feature +20 -88
  86. data/features/rails_features/send_code.feature +13 -59
  87. data/features/rails_features/send_environment.feature +7 -35
  88. data/features/rails_features/unhandled.feature +6 -33
  89. data/features/rails_features/user_info.feature +27 -68
  90. data/features/sidekiq.feature +12 -79
  91. data/features/steps/ruby_notifier_steps.rb +59 -15
  92. data/features/support/env.rb +12 -45
  93. data/lib/bugsnag/cleaner.rb +2 -3
  94. data/lib/bugsnag/configuration.rb +12 -0
  95. data/lib/bugsnag/stacktrace.rb +1 -4
  96. data/spec/configuration_spec.rb +11 -0
  97. data/spec/fixtures/apps/rails-initializer-config/Gemfile +5 -1
  98. data/spec/fixtures/apps/rails-invalid-initializer-config/Gemfile +5 -1
  99. data/spec/fixtures/apps/rails-no-config/Gemfile +5 -1
  100. data/spec/integrations/logger_spec.rb +1 -1
  101. data/spec/integrations/rake_spec.rb +1 -1
  102. data/spec/stacktrace_spec.rb +39 -0
  103. metadata +21 -5
  104. data/.travis.yml +0 -122
  105. data/features/plain_features/api_key.feature +0 -25
@@ -0,0 +1,9 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Start perform ActiveJob",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "event_name": "perform_start.active_job",
7
+ "event_id": ".*"
8
+ }
9
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Mongo query failed",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "command_name": "bogus",
7
+ "database_name": "^rails\\d_development$",
8
+ "operation_id": "NUMBER",
9
+ "event_name": "mongo.failed",
10
+ "request_id": "NUMBER",
11
+ "duration": "NUMBER",
12
+ "collection": 1,
13
+ "message": "no such command: 'bogus' (59)"
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Mongo query succeeded",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "command_name": "find",
7
+ "database_name": "^rails\\d_development$",
8
+ "operation_id": "NUMBER",
9
+ "event_name": "mongo.succeeded",
10
+ "request_id": "NUMBER",
11
+ "duration": "NUMBER",
12
+ "collection": "mongo_models",
13
+ "filter": "{\"string_field\":\"?\"}"
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Mongo query succeeded",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "command_name": "find",
7
+ "database_name": "^rails\\d_development$",
8
+ "operation_id": "NUMBER",
9
+ "event_name": "mongo.succeeded",
10
+ "request_id": "NUMBER",
11
+ "duration": "NUMBER",
12
+ "collection": "mongo_models",
13
+ "filter": "{\"$or\":[{\"string_field\":\"?\"},{\"numeric_field\":\"?\"}]}"
14
+ }
15
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Mongo query succeeded",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "command_name": "insert",
7
+ "database_name": "^rails\\d_development$",
8
+ "operation_id": "NUMBER",
9
+ "event_name": "mongo.succeeded",
10
+ "request_id": "NUMBER",
11
+ "duration": "NUMBER",
12
+ "collection": "mongo_models"
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "type": "request",
3
+ "name": "Controller started processing",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "controller": "BreadcrumbsController",
7
+ "action": "handled",
8
+ "method": "GET",
9
+ "path": "/breadcrumbs/handled",
10
+ "event_name": "start_processing.action_controller",
11
+ "event_id": ".*"
12
+ }
13
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "type": "process",
3
+ "name": "ActiveRecord SQL query",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "name": "User Load",
7
+ "connection_id": "NUMBER",
8
+ "event_name": "sql.active_record",
9
+ "event_id": ".*",
10
+ "binds": "{\"email\":\"?\",\"LIMIT\":\"?\"}"
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "type": "process",
3
+ "name": "ActiveRecord SQL query",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "name": "User Load",
7
+ "connection_id": "NUMBER",
8
+ "event_name": "sql.active_record",
9
+ "event_id": ".*"
10
+ }
11
+ }
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -4,13 +4,11 @@ require 'pp'
4
4
  def configure_basics
5
5
  Bugsnag.configure do |conf|
6
6
  conf.api_key = ENV['BUGSNAG_API_KEY']
7
- conf.endpoint = ENV['BUGSNAG_ENDPOINT']
8
- conf.session_endpoint = ENV["BUGSNAG_SESSION_ENDPOINT"] if ENV.include? "BUGSNAG_SESSION_ENDPOINT"
7
+ conf.set_endpoints(ENV['BUGSNAG_ENDPOINT'], ENV["BUGSNAG_ENDPOINT"])
9
8
  end
10
9
  end
11
10
 
12
11
  def configure_using_environment
13
- pp ENV
14
12
  Bugsnag.configure do |conf|
15
13
  conf.app_type = ENV["BUGSNAG_APP_TYPE"] if ENV.include? "BUGSNAG_APP_TYPE"
16
14
  conf.app_version = ENV["BUGSNAG_APP_VERSION"] if ENV.include? "BUGSNAG_APP_VERSION"
@@ -13,6 +13,8 @@ Bugsnag.notify("handled string") do |report|
13
13
  })
14
14
  end
15
15
 
16
+ # Added to stop Process deadlock
17
+ sleep(0.01)
16
18
  Process.fork do
17
19
  Bugsnag.notify("handled string number 2") do |report|
18
20
  report.add_tab(:config, {
@@ -22,4 +24,4 @@ Process.fork do
22
24
  end
23
25
  end
24
26
 
25
- Process.wait
27
+ Process.wait
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'rake', '~> 12.3.0'
4
+
3
5
  gem 'rails', '3.2.22.5'
4
6
 
5
7
  gem 'nokogiri', '1.6.8'
@@ -10,4 +12,6 @@ gem 'jquery-rails'
10
12
 
11
13
  gem 'bugsnag', path: '/bugsnag'
12
14
 
15
+ gem 'rack-cache', '~> 1.9.0'
16
+
13
17
  gem "warden"
@@ -7,7 +7,7 @@ Bugsnag.configure do |config|
7
7
  config.auto_notify = ENV["BUGSNAG_AUTO_NOTIFY"] != "false"
8
8
  config.project_root = ENV["BUGSNAG_PROJECT_ROOT"] if ENV.include? "BUGSNAG_PROJECT_ROOT"
9
9
  config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["BUGSNAG_IGNORE_CLASS"] } if ENV.include? "BUGSNAG_IGNORE_CLASS"
10
- config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"]
10
+ config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"] == "true"
11
11
  config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] if ENV.include? "BUGSNAG_RELEASE_STAGE"
12
12
  config.send_code = ENV["BUGSNAG_SEND_CODE"] != "false"
13
13
  config.send_environment = ENV["BUGSNAG_SEND_ENVIRONMENT"] == "true"
@@ -1,8 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
3
-
4
- ARG RUBY_VERSION
5
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
6
3
 
7
4
  WORKDIR /bugsnag
8
5
  COPY temp-bugsnag-lib ./
@@ -7,7 +7,7 @@ Bugsnag.configure do |config|
7
7
  config.auto_notify = ENV["BUGSNAG_AUTO_NOTIFY"] != "false"
8
8
  config.project_root = ENV["BUGSNAG_PROJECT_ROOT"] if ENV.include? "BUGSNAG_PROJECT_ROOT"
9
9
  config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["BUGSNAG_IGNORE_CLASS"] } if ENV.include? "BUGSNAG_IGNORE_CLASS"
10
- config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"]
10
+ config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"] == "true"
11
11
  config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] if ENV.include? "BUGSNAG_RELEASE_STAGE"
12
12
  config.send_code = ENV["BUGSNAG_SEND_CODE"] != "false"
13
13
  config.send_environment = ENV["BUGSNAG_SEND_ENVIRONMENT"] == "true"
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -7,7 +7,7 @@ Bugsnag.configure do |config|
7
7
  config.auto_notify = ENV["BUGSNAG_AUTO_NOTIFY"] != "false"
8
8
  config.project_root = ENV["BUGSNAG_PROJECT_ROOT"] if ENV.include? "BUGSNAG_PROJECT_ROOT"
9
9
  config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["BUGSNAG_IGNORE_CLASS"] } if ENV.include? "BUGSNAG_IGNORE_CLASS"
10
- config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"]
10
+ config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"] == "true"
11
11
  config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] if ENV.include? "BUGSNAG_RELEASE_STAGE"
12
12
  config.send_code = ENV["BUGSNAG_SEND_CODE"] != "false"
13
13
  config.send_environment = ENV["BUGSNAG_SEND_ENVIRONMENT"] == "true"
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  RUN apt-get update
5
5
 
@@ -51,7 +51,8 @@ end
51
51
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
52
52
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
53
53
 
54
- # Added at 2019-04-24 17:24:14 +0100 by amoinet:
55
- gem "bugsnag", "~> 6.11"
54
+ gem 'bugsnag', path: '/bugsnag'
55
+
56
+ gem "mongoid"
56
57
 
57
58
  gem "clearance", "~> 1.16"
@@ -0,0 +1,22 @@
1
+ class MongoController < ApplicationController
2
+ def success_crash
3
+ doc = MongoModel.create(string_field: "String")
4
+ doc.save
5
+ "Statement".prepnd("Failing")
6
+ end
7
+
8
+ def get_crash
9
+ MongoModel.where(string_field: true).as_json
10
+ MongoModel.any_of({string_field: true}, {numeric_field: 123}).as_json
11
+ "Statement".prepnd("Failing")
12
+ end
13
+
14
+ def failure_crash
15
+ begin
16
+ Mongoid::Clients.default.database.command(:bogus => 1)
17
+ rescue
18
+ end
19
+
20
+ "Statement".prepnd("Failing")
21
+ end
22
+ end
@@ -0,0 +1,6 @@
1
+ class MongoModel
2
+ include Mongoid::Document
3
+
4
+ field :string_field, type: String
5
+ field :numeric_field, type: Integer
6
+ end
@@ -59,4 +59,6 @@ Rails.application.configure do
59
59
  # Use an evented file watcher to asynchronously detect changes in source code,
60
60
  # routes, locales, etc. This feature depends on the listen gem.
61
61
  config.file_watcher = ActiveSupport::EventedFileUpdateChecker
62
+
63
+ config.hosts << "rails6"
62
64
  end
@@ -109,4 +109,5 @@ Rails.application.configure do
109
109
  # config.active_record.database_selector = { delay: 2.seconds }
110
110
  # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
111
111
  # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
112
+ config.hosts << "rails6"
112
113
  end
@@ -52,4 +52,5 @@ Rails.application.configure do
52
52
  # routes, locales, etc. This feature depends on the listen gem.
53
53
  config.file_watcher = ActiveSupport::EventedFileUpdateChecker
54
54
  config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
55
+ config.hosts << "rails6"
55
56
  end
@@ -44,4 +44,5 @@ Rails.application.configure do
44
44
 
45
45
  # Raises error for missing translations.
46
46
  # config.action_view.raise_on_missing_translations = true
47
+ config.hosts << "rails6"
47
48
  end
@@ -7,7 +7,7 @@ Bugsnag.configure do |config|
7
7
  config.auto_notify = ENV["BUGSNAG_AUTO_NOTIFY"] != "false"
8
8
  config.project_root = ENV["BUGSNAG_PROJECT_ROOT"] if ENV.include? "BUGSNAG_PROJECT_ROOT"
9
9
  config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["BUGSNAG_IGNORE_CLASS"] } if ENV.include? "BUGSNAG_IGNORE_CLASS"
10
- config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"]
10
+ config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"] == "true"
11
11
  config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] if ENV.include? "BUGSNAG_RELEASE_STAGE"
12
12
  config.send_code = ENV["BUGSNAG_SEND_CODE"] != "false"
13
13
  config.send_environment = ENV["BUGSNAG_SEND_ENVIRONMENT"] == "true"
@@ -0,0 +1,23 @@
1
+ development:
2
+ # Configure available database clients. (required)
3
+ clients:
4
+ # Defines the default client. (required)
5
+ default:
6
+ # Defines the name of the default database that Mongoid can connect to.
7
+ # (required).
8
+ database: rails6_development
9
+ # Provides the hosts the default client can connect to. Must be an array
10
+ # of host:port pairs. (required)
11
+ hosts:
12
+ - mongo:27017
13
+
14
+ test:
15
+ clients:
16
+ default:
17
+ database: rails6_test
18
+ hosts:
19
+ - mongo:27017
20
+ options:
21
+ read:
22
+ mode: :primary
23
+ max_pool_size: 1
@@ -55,4 +55,8 @@ Rails.application.routes.draw do
55
55
  get 'breadcrumbs/sql_breadcrumb', to: 'breadcrumbs#sql_breadcrumb'
56
56
  get 'breadcrumbs/active_job', to: 'breadcrumbs#active_job'
57
57
  get 'breadcrumbs/cache_read', to: 'breadcrumbs#cache_read'
58
+
59
+ get 'mongo/success_crash', to: 'mongo#success_crash'
60
+ get 'mongo/get_crash', to: 'mongo#get_crash'
61
+ get 'mongo/failure_crash', to: 'mongo#failure_crash'
58
62
  end
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -1,19 +1,17 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
6
6
 
7
7
  ARG APP_PATH
8
8
 
9
- WORKDIR $APP_PATH
9
+ WORKDIR /app/
10
10
 
11
+ COPY app/Gemfile Gemfile
11
12
  ARG SIDEKIQ_VERSION
12
13
  ENV SIDEKIQ_VERSION $SIDEKIQ_VERSION
13
14
 
14
- COPY app/Gemfile $APP_PATH
15
15
  RUN bundle install
16
16
 
17
- COPY app/ $APP_PATH
18
-
19
- CMD ["bundle", "exec", "sidekiq", "-r", "./app.rb"]
17
+ COPY app/ /app/
@@ -3,4 +3,5 @@ source 'https://rubygems.org'
3
3
  gem 'bugsnag', path: '/bugsnag'
4
4
  gem 'sidekiq', ENV['SIDEKIQ_VERSION']
5
5
  gem 'timers', '~> 4.1.1'
6
- gem 'redis', '~> 3.3.5'
6
+ gem 'redis', '~> 3.3.5'
7
+ gem 'rake', '~> 12.3.0'
@@ -0,0 +1,14 @@
1
+ namespace :sidekiq_tests do
2
+ task :handled_error do
3
+ run_sidekiq_test('./initializers/HandledError.rb')
4
+ end
5
+
6
+ task :unhandled_error do
7
+ run_sidekiq_test('./initializers/UnhandledError.rb')
8
+ end
9
+ end
10
+
11
+ def run_sidekiq_test(command)
12
+ system("ruby #{command}")
13
+ system("sidekiq -r ./app.rb")
14
+ end
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./