bugsnag 6.12.1 → 6.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/.buildkite/pipeline.yml +470 -0
  3. data/.rubocop.yml +55 -0
  4. data/.rubocop_todo.yml +530 -160
  5. data/CHANGELOG.md +73 -0
  6. data/CONTRIBUTING.md +1 -9
  7. data/Gemfile +14 -7
  8. data/TESTING.md +81 -0
  9. data/VERSION +1 -1
  10. data/docker-compose.yml +46 -0
  11. data/dockerfiles/Dockerfile.jruby-unit-tests +13 -0
  12. data/dockerfiles/Dockerfile.ruby-maze-runner +26 -0
  13. data/dockerfiles/Dockerfile.ruby-unit-tests +12 -0
  14. data/features/delayed_job.feature +6 -22
  15. data/features/fixtures/delayed_job/Dockerfile +2 -4
  16. data/features/fixtures/delayed_job/app/Gemfile +1 -1
  17. data/features/fixtures/delayed_job/app/Rakefile +18 -0
  18. data/features/fixtures/docker-compose.yml +32 -40
  19. data/features/fixtures/expected_breadcrumbs/active_job.json +9 -0
  20. data/features/fixtures/expected_breadcrumbs/mongo_failed.json +15 -0
  21. data/features/fixtures/expected_breadcrumbs/mongo_filtered_request.json +15 -0
  22. data/features/fixtures/expected_breadcrumbs/mongo_filtered_result.json +15 -0
  23. data/features/fixtures/expected_breadcrumbs/mongo_success.json +14 -0
  24. data/features/fixtures/expected_breadcrumbs/request.json +13 -0
  25. data/features/fixtures/expected_breadcrumbs/sql_with_bindings.json +12 -0
  26. data/features/fixtures/expected_breadcrumbs/sql_without_bindings.json +11 -0
  27. data/features/fixtures/plain/Dockerfile +2 -2
  28. data/features/fixtures/plain/app/app.rb +1 -3
  29. data/features/fixtures/plain/app/delivery/fork_threadpool.rb +3 -1
  30. data/features/fixtures/plain/app/report_modification/initiators/handled_on_error.rb +10 -0
  31. data/features/fixtures/plain/app/report_modification/initiators/unhandled_on_error.rb +11 -0
  32. data/features/fixtures/plain/app/stack_frame_modification/initiators/handled_on_error.rb +29 -0
  33. data/features/fixtures/plain/app/stack_frame_modification/initiators/unhandled_on_error.rb +26 -0
  34. data/features/fixtures/plain/app/unhandled/{Interrupt.rb → interrupt.rb} +0 -0
  35. data/features/fixtures/rack1/Dockerfile +2 -2
  36. data/features/fixtures/rack2/Dockerfile +2 -2
  37. data/features/fixtures/rails3/Dockerfile +2 -2
  38. data/features/fixtures/rails3/app/Gemfile +4 -0
  39. data/features/fixtures/rails3/app/config/initializers/bugsnag.rb +11 -2
  40. data/features/fixtures/rails4/Dockerfile +2 -5
  41. data/features/fixtures/rails4/app/config/initializers/bugsnag.rb +10 -1
  42. data/features/fixtures/rails5/Dockerfile +2 -2
  43. data/features/fixtures/rails5/app/Gemfile +3 -2
  44. data/features/fixtures/rails5/app/config/initializers/bugsnag.rb +10 -1
  45. data/features/fixtures/rails6/Dockerfile +2 -2
  46. data/features/fixtures/rails6/app/Gemfile +3 -2
  47. data/features/fixtures/rails6/app/app/controllers/mongo_controller.rb +22 -0
  48. data/features/fixtures/rails6/app/app/models/mongo_model.rb +6 -0
  49. data/features/fixtures/rails6/app/config/environments/development.rb +2 -0
  50. data/features/fixtures/rails6/app/config/environments/production.rb +1 -0
  51. data/features/fixtures/rails6/app/config/environments/rails_env.rb +1 -0
  52. data/features/fixtures/rails6/app/config/environments/test.rb +1 -0
  53. data/features/fixtures/rails6/app/config/initializers/bugsnag.rb +10 -1
  54. data/features/fixtures/rails6/app/config/mongoid.yml +23 -0
  55. data/features/fixtures/rails6/app/config/routes.rb +4 -0
  56. data/features/fixtures/resque/Dockerfile +2 -2
  57. data/features/fixtures/sidekiq/Dockerfile +5 -7
  58. data/features/fixtures/sidekiq/app/Gemfile +2 -1
  59. data/features/fixtures/sidekiq/app/Rakefile.rb +14 -0
  60. data/features/fixtures/sinatra1/Dockerfile +2 -2
  61. data/features/fixtures/sinatra2/Dockerfile +2 -2
  62. data/features/plain_features/add_tab.feature +30 -97
  63. data/features/plain_features/app_type.feature +6 -25
  64. data/features/plain_features/app_version.feature +6 -25
  65. data/features/plain_features/auto_notify.feature +4 -20
  66. data/features/plain_features/delivery.feature +12 -60
  67. data/features/plain_features/exception_data.feature +24 -94
  68. data/features/plain_features/filters.feature +9 -43
  69. data/features/plain_features/handled_errors.feature +16 -78
  70. data/features/plain_features/ignore_classes.feature +5 -23
  71. data/features/plain_features/ignore_report.feature +8 -24
  72. data/features/plain_features/proxies.feature +13 -56
  73. data/features/plain_features/release_stages.feature +9 -40
  74. data/features/plain_features/report_api_key.feature +11 -35
  75. data/features/plain_features/report_severity.feature +10 -35
  76. data/features/plain_features/report_stack_frames.feature +29 -93
  77. data/features/plain_features/report_user.feature +29 -96
  78. data/features/plain_features/unhandled_errors.feature +17 -88
  79. data/features/rails_features/api_key.feature +12 -58
  80. data/features/rails_features/app_type.feature +13 -58
  81. data/features/rails_features/app_version.feature +19 -80
  82. data/features/rails_features/auto_capture_sessions.feature +31 -112
  83. data/features/rails_features/auto_notify.feature +28 -105
  84. data/features/rails_features/before_notify.feature +18 -83
  85. data/features/rails_features/breadcrumbs.feature +40 -137
  86. data/features/rails_features/handled.feature +18 -82
  87. data/features/rails_features/ignore_classes.feature +12 -51
  88. data/features/rails_features/meta_data_filters.feature +9 -33
  89. data/features/rails_features/mongo_breadcrumbs.feature +22 -96
  90. data/features/rails_features/on_error.feature +29 -0
  91. data/features/rails_features/project_root.feature +19 -84
  92. data/features/rails_features/release_stage.feature +20 -82
  93. data/features/rails_features/send_code.feature +13 -55
  94. data/features/rails_features/send_environment.feature +7 -33
  95. data/features/rails_features/unhandled.feature +6 -31
  96. data/features/rails_features/user_info.feature +27 -65
  97. data/features/sidekiq.feature +12 -79
  98. data/features/steps/ruby_notifier_steps.rb +59 -15
  99. data/features/support/env.rb +12 -45
  100. data/lib/bugsnag.rb +109 -21
  101. data/lib/bugsnag/breadcrumbs/breadcrumbs.rb +0 -2
  102. data/lib/bugsnag/breadcrumbs/validator.rb +0 -6
  103. data/lib/bugsnag/cleaner.rb +129 -60
  104. data/lib/bugsnag/code_extractor.rb +137 -0
  105. data/lib/bugsnag/configuration.rb +58 -1
  106. data/lib/bugsnag/helpers.rb +2 -4
  107. data/lib/bugsnag/integrations/que.rb +7 -4
  108. data/lib/bugsnag/middleware/discard_error_class.rb +30 -0
  109. data/lib/bugsnag/middleware/exception_meta_data.rb +15 -9
  110. data/lib/bugsnag/middleware/ignore_error_class.rb +2 -0
  111. data/lib/bugsnag/middleware/rack_request.rb +2 -4
  112. data/lib/bugsnag/middleware_stack.rb +38 -3
  113. data/lib/bugsnag/on_error_callbacks.rb +33 -0
  114. data/lib/bugsnag/report.rb +4 -14
  115. data/lib/bugsnag/session_tracker.rb +3 -3
  116. data/lib/bugsnag/stacktrace.rb +28 -75
  117. data/spec/breadcrumbs/breadcrumb_spec.rb +1 -1
  118. data/spec/breadcrumbs/validator_spec.rb +1 -26
  119. data/spec/bugsnag_spec.rb +2 -2
  120. data/spec/cleaner_spec.rb +202 -10
  121. data/spec/code_extractor_spec.rb +129 -0
  122. data/spec/configuration_spec.rb +16 -1
  123. data/spec/fixtures/apps/rails-initializer-config/Gemfile +5 -1
  124. data/spec/fixtures/apps/rails-invalid-initializer-config/Gemfile +5 -1
  125. data/spec/fixtures/apps/rails-no-config/Gemfile +5 -1
  126. data/spec/fixtures/crashes/file1.rb +29 -0
  127. data/spec/fixtures/crashes/file2.rb +25 -0
  128. data/spec/fixtures/crashes/file_with_long_lines.rb +7 -0
  129. data/spec/fixtures/crashes/functions.rb +29 -0
  130. data/spec/fixtures/crashes/short_file.rb +2 -0
  131. data/spec/helper_spec.rb +0 -31
  132. data/spec/integrations/logger_spec.rb +1 -1
  133. data/spec/integrations/rack_spec.rb +8 -6
  134. data/spec/integrations/rake_spec.rb +1 -1
  135. data/spec/on_error_spec.rb +332 -0
  136. data/spec/report_spec.rb +331 -30
  137. data/spec/spec_helper.rb +14 -1
  138. data/spec/stacktrace_spec.rb +427 -74
  139. metadata +36 -7
  140. data/.travis.yml +0 -117
  141. data/features/plain_features/api_key.feature +0 -25
@@ -1,89 +1,27 @@
1
1
  Feature: Release stage
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I set environment variable "APP_PATH" to "/usr/src"
6
- And I configure the bugsnag endpoint
7
-
8
- Scenario Outline: Release_stage should default to RAILS_ENV
9
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
10
- And I set environment variable "RAILS_ENV" to "rails_env"
11
- And I start the service "rails<rails_version>"
12
- And I wait for the app to respond on port "6128<rails_version>"
13
- When I navigate to the route "/release_stage/default" on port "6128<rails_version>"
14
- Then I should receive a request
15
- And the request is a valid for the error reporting API
16
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
17
- And the payload field "events" is an array with 1 element
3
+ @rails3 @rails4 @rails5 @rails6
4
+ Scenario: Release_stage should default to RAILS_ENV
5
+ Given I set environment variable "RAILS_ENV" to "rails_env"
6
+ And I start the rails service
7
+ When I navigate to the route "/release_stage/default" on the rails app
8
+ And I wait to receive a request
9
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
18
10
  And the event "app.releaseStage" equals "rails_env"
19
11
 
20
- Examples:
21
- | ruby_version | rails_version |
22
- | 2.0 | 3 |
23
- | 2.1 | 3 |
24
- | 2.2 | 3 |
25
- | 2.2 | 4 |
26
- | 2.2 | 5 |
27
- | 2.3 | 3 |
28
- | 2.3 | 4 |
29
- | 2.3 | 5 |
30
- | 2.4 | 3 |
31
- | 2.4 | 5 |
32
- | 2.5 | 3 |
33
- | 2.5 | 5 |
34
- | 2.5 | 6 |
35
-
36
- Scenario Outline: Release_stage can be set in an initializer
37
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
38
- And I set environment variable "BUGSNAG_RELEASE_STAGE" to "maze_release_stage_env"
39
- And I start the service "rails<rails_version>"
40
- And I wait for the app to respond on port "6128<rails_version>"
41
- When I navigate to the route "/release_stage/default" on port "6128<rails_version>"
42
- Then I should receive a request
43
- And the request is a valid for the error reporting API
44
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
45
- And the payload field "events" is an array with 1 element
12
+ @rails3 @rails4 @rails5 @rails6
13
+ Scenario: Release_stage can be set in an initializer
14
+ Given I set environment variable "BUGSNAG_RELEASE_STAGE" to "maze_release_stage_env"
15
+ And I start the rails service
16
+ When I navigate to the route "/release_stage/default" on the rails app
17
+ And I wait to receive a request
18
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
46
19
  And the event "app.releaseStage" equals "maze_release_stage_env"
47
20
 
48
- Examples:
49
- | ruby_version | rails_version |
50
- | 2.0 | 3 |
51
- | 2.1 | 3 |
52
- | 2.2 | 3 |
53
- | 2.2 | 4 |
54
- | 2.2 | 5 |
55
- | 2.3 | 3 |
56
- | 2.3 | 4 |
57
- | 2.3 | 5 |
58
- | 2.4 | 3 |
59
- | 2.4 | 5 |
60
- | 2.5 | 3 |
61
- | 2.5 | 5 |
62
- | 2.5 | 6 |
63
-
64
- Scenario Outline: Release_stage can be set after an initializer
65
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
66
- And I start the service "rails<rails_version>"
67
- And I wait for the app to respond on port "6128<rails_version>"
68
- When I navigate to the route "/release_stage/after?stage=set_after_env" on port "6128<rails_version>"
69
- Then I should receive a request
70
- And the request is a valid for the error reporting API
71
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
72
- And the payload field "events" is an array with 1 element
21
+ @rails3 @rails4 @rails5 @rails6
22
+ Scenario: Release_stage can be set after an initializer
23
+ Given I start the rails service
24
+ When I navigate to the route "/release_stage/after?stage=set_after_env" on the rails app
25
+ And I wait to receive a request
26
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
73
27
  And the event "app.releaseStage" equals "set_after_env"
74
-
75
- Examples:
76
- | ruby_version | rails_version |
77
- | 2.0 | 3 |
78
- | 2.1 | 3 |
79
- | 2.2 | 3 |
80
- | 2.2 | 4 |
81
- | 2.2 | 5 |
82
- | 2.3 | 3 |
83
- | 2.3 | 4 |
84
- | 2.3 | 5 |
85
- | 2.4 | 3 |
86
- | 2.4 | 5 |
87
- | 2.5 | 3 |
88
- | 2.5 | 5 |
89
- | 2.5 | 6 |
@@ -1,60 +1,18 @@
1
1
  Feature: Send code
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I set environment variable "APP_PATH" to "/usr/src"
6
- And I configure the bugsnag endpoint
7
-
8
- Scenario Outline: Send_code can be updated in an initializer
9
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
10
- And I set environment variable "BUGSNAG_SEND_CODE" to "false"
11
- And I start the service "rails<rails_version>"
12
- And I wait for the app to respond on port "6128<rails_version>"
13
- When I navigate to the route "/send_code/initializer" on port "6128<rails_version>"
14
- Then I should receive a request
15
- And the request is a valid for the error reporting API
16
- And the payload field "events" is an array with 1 element
3
+ @rails3 @rails4 @rails5 @rails6
4
+ Scenario: Send_code can be updated in an initializer
5
+ Given I set environment variable "BUGSNAG_SEND_CODE" to "false"
6
+ And I start the rails service
7
+ When I navigate to the route "/send_code/initializer" on the rails app
8
+ And I wait to receive a request
9
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
17
10
  And the event "exceptions.0.stacktrace.0.code" is null
18
11
 
19
- Examples:
20
- | ruby_version | rails_version |
21
- | 2.0 | 3 |
22
- | 2.1 | 3 |
23
- | 2.2 | 3 |
24
- | 2.2 | 4 |
25
- | 2.2 | 5 |
26
- | 2.3 | 3 |
27
- | 2.3 | 4 |
28
- | 2.3 | 5 |
29
- | 2.4 | 3 |
30
- | 2.4 | 5 |
31
- | 2.5 | 3 |
32
- | 2.5 | 5 |
33
- | 2.5 | 6 |
34
-
35
- Scenario Outline: Send_code can be updated after an initializer
36
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
37
- And I start the service "rails<rails_version>"
38
- And I wait for the app to respond on port "6128<rails_version>"
39
- When I navigate to the route "/send_code/after" on port "6128<rails_version>"
40
- Then I should receive a request
41
- And the request is a valid for the error reporting API
42
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
43
- And the payload field "events" is an array with 1 element
12
+ @rails3 @rails4 @rails5 @rails6
13
+ Scenario: Send_code can be updated after an initializer
14
+ Given I start the rails service
15
+ When I navigate to the route "/send_code/after" on the rails app
16
+ And I wait to receive a request
17
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
44
18
  And the event "exceptions.0.stacktrace.0.code" is null
45
-
46
- Examples:
47
- | ruby_version | rails_version |
48
- | 2.0 | 3 |
49
- | 2.1 | 3 |
50
- | 2.2 | 3 |
51
- | 2.2 | 4 |
52
- | 2.2 | 5 |
53
- | 2.3 | 3 |
54
- | 2.3 | 4 |
55
- | 2.3 | 5 |
56
- | 2.4 | 3 |
57
- | 2.4 | 5 |
58
- | 2.5 | 3 |
59
- | 2.5 | 5 |
60
- | 2.5 | 6 |
@@ -1,39 +1,13 @@
1
1
  Feature: Send environment
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I set environment variable "APP_PATH" to "/usr/src"
6
- And I configure the bugsnag endpoint
7
-
8
- Scenario Outline: Send_environment should send environment in handled errors when true
9
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
10
- And I set environment variable "BUGSNAG_SEND_ENVIRONMENT" to "true"
11
- And I start the service "rails<rails_version>"
12
- And I wait for the app to respond on port "6128<rails_version>"
13
- When I navigate to the route "/send_environment/initializer" on port "6128<rails_version>"
14
- Then I should receive a request
15
- And the request is a valid for the error reporting API
16
- And the request used the "Ruby Bugsnag Notifier" notifier
17
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
18
- And the payload field "events" is an array with 1 element
3
+ @rails3 @rails4 @rails5 @rails6
4
+ Scenario: Send_environment should send environment in handled errors when true
5
+ Given I set environment variable "BUGSNAG_SEND_ENVIRONMENT" to "true"
6
+ And I start the rails service
7
+ When I navigate to the route "/send_environment/initializer" on the rails app
8
+ And I wait to receive a request
9
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
19
10
  And the exception "errorClass" equals "RuntimeError"
20
11
  And the exception "message" starts with "handled string"
21
12
  And the event "metaData.environment.REQUEST_METHOD" equals "GET"
22
- And the event "metaData.environment.railsVersion" is not null
23
13
  And the event "app.type" equals "rails"
24
-
25
- Examples:
26
- | ruby_version | rails_version |
27
- | 2.0 | 3 |
28
- | 2.1 | 3 |
29
- | 2.2 | 3 |
30
- | 2.2 | 4 |
31
- | 2.2 | 5 |
32
- | 2.3 | 3 |
33
- | 2.3 | 4 |
34
- | 2.3 | 5 |
35
- | 2.4 | 3 |
36
- | 2.4 | 5 |
37
- | 2.5 | 3 |
38
- | 2.5 | 5 |
39
- | 2.5 | 6 |
@@ -1,20 +1,11 @@
1
1
  Feature: Unhandled exceptions support
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I set environment variable "APP_PATH" to "/usr/src"
6
- And I configure the bugsnag endpoint
7
-
8
- Scenario Outline: Unhandled RuntimeError
9
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
10
- And I start the service "rails<rails_version>"
11
- And I wait for the app to respond on port "6128<rails_version>"
12
- When I navigate to the route "/unhandled/error" on port "6128<rails_version>"
13
- Then I should receive a request
14
- And the request is a valid for the error reporting API
15
- And the request used the "Ruby Bugsnag Notifier" notifier
16
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
17
- And the payload field "events" is an array with 1 element
3
+ @rails3 @rails4 @rails5 @rails6
4
+ Scenario: Unhandled RuntimeError
5
+ Given I start the rails service
6
+ When I navigate to the route "/unhandled/error" on the rails app
7
+ And I wait to receive a request
8
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
18
9
  And the event "unhandled" is true
19
10
  And the exception "errorClass" equals "NameError"
20
11
  And the exception "message" starts with "undefined local variable or method `generate_unhandled_error' for #<UnhandledController"
@@ -23,19 +14,3 @@ Scenario Outline: Unhandled RuntimeError
23
14
  And the event "severity" equals "error"
24
15
  And the event "severityReason.type" equals "unhandledExceptionMiddleware"
25
16
  And the event "severityReason.attributes.framework" equals "Rack"
26
-
27
- Examples:
28
- | ruby_version | rails_version |
29
- | 2.0 | 3 |
30
- | 2.1 | 3 |
31
- | 2.2 | 3 |
32
- | 2.2 | 4 |
33
- | 2.2 | 5 |
34
- | 2.3 | 3 |
35
- | 2.3 | 4 |
36
- | 2.3 | 5 |
37
- | 2.4 | 3 |
38
- | 2.4 | 5 |
39
- | 2.5 | 3 |
40
- | 2.5 | 5 |
41
- | 2.5 | 6 |
@@ -1,90 +1,52 @@
1
1
  Feature: Capture user information
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I set environment variable "APP_PATH" to "/usr/src"
6
- And I configure the bugsnag endpoint
7
-
3
+ @rails3
8
4
  Scenario Outline: Warden user information is sent
9
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
10
- And I start the service "rails<rails_version>"
11
- And I wait for the app to respond on port "6128<rails_version>"
12
- When I navigate to the route "/warden/create" on port "6128<rails_version>"
13
- And I navigate to the route "/warden/<route>?email=testtest@test.test" on port "6128<rails_version>"
14
- Then I should receive a request
15
- And the request is a valid for the error reporting API
16
- And the request used the "Ruby Bugsnag Notifier" notifier
17
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
18
- And the payload field "events" is an array with 1 element
5
+ Given I start the rails service
6
+ When I navigate to the route "/warden/create" on the rails app
7
+ And I navigate to the route "/warden/<route>?email=testtest@test.test" on the rails app
8
+ And I wait to receive a request
9
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
19
10
  And the event "user.email" equals "testtest@test.test"
20
11
  And the event "user.name" equals "Warden User"
21
12
  And the event "user.first_name" equals "Warden"
22
13
  And the event "user.last_name" equals "User"
23
14
 
24
15
  Examples:
25
- | ruby_version | rails_version | route |
26
- | 2.0 | 3 | handled |
27
- | 2.0 | 3 | unhandled |
28
- | 2.1 | 3 | handled |
29
- | 2.1 | 3 | unhandled |
30
- | 2.2 | 3 | handled |
31
- | 2.2 | 3 | unhandled |
32
- | 2.3 | 3 | handled |
33
- | 2.3 | 3 | unhandled |
34
- | 2.4 | 3 | handled |
35
- | 2.4 | 3 | unhandled |
36
- | 2.5 | 3 | handled |
37
- | 2.5 | 3 | unhandled |
38
-
16
+ | route |
17
+ | handled |
18
+ | unhandled |
39
19
 
20
+ @rails4
40
21
  Scenario Outline: Devise user information is sent
41
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
42
- And I start the service "rails<rails_version>"
43
- And I wait for the app to respond on port "6128<rails_version>"
44
- When I navigate to the route "/devise/create" on port "6128<rails_version>"
45
- And I navigate to the route "/devise/<route>" on port "6128<rails_version>"
46
- Then I should receive a request
47
- And the request is a valid for the error reporting API
48
- And the request used the "Ruby Bugsnag Notifier" notifier
49
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
50
- And the payload field "events" is an array with 1 element
22
+ Given I start the rails service
23
+ When I navigate to the route "/devise/create" on the rails app
24
+ And I navigate to the route "/devise/<route>" on the rails app
25
+ And I wait to receive a request
26
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
51
27
  And the event "user.email" equals "test+test@test.test"
52
28
  And the event "user.name" equals "Devise User"
53
29
  And the event "user.first_name" equals "Devise"
54
30
  And the event "user.last_name" equals "User"
55
31
 
56
32
  Examples:
57
- | ruby_version | rails_version | route |
58
- | 2.2 | 4 | handled |
59
- | 2.2 | 4 | unhandled |
60
- | 2.3 | 4 | handled |
61
- | 2.3 | 4 | unhandled |
33
+ | route |
34
+ | handled |
35
+ | unhandled |
62
36
 
37
+ @rails5 @rails6
63
38
  Scenario Outline: Clearance user information is sent
64
- Given I set environment variable "RUBY_VERSION" to "<ruby_version>"
65
- And I start the service "rails<rails_version>"
66
- And I wait for the app to respond on port "6128<rails_version>"
67
- When I navigate to the route "/clearance/create" on port "6128<rails_version>"
68
- And I navigate to the route "/clearance/<route>" on port "6128<rails_version>"
69
- Then I should receive a request
70
- And the request is a valid for the error reporting API
71
- And the request used the "Ruby Bugsnag Notifier" notifier
72
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
73
- And the payload field "events" is an array with 1 element
39
+ Given I start the rails service
40
+ When I navigate to the route "/clearance/create" on the rails app
41
+ And I navigate to the route "/clearance/<route>" on the rails app
42
+ And I wait to receive a request
43
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
74
44
  And the event "user.email" equals "testtest@test.test"
75
45
  And the event "user.name" equals "Clearance User"
76
46
  And the event "user.first_name" equals "Clearance"
77
47
  And the event "user.last_name" equals "User"
78
48
 
79
49
  Examples:
80
- | ruby_version | rails_version | route |
81
- | 2.2 | 5 | handled |
82
- | 2.2 | 5 | unhandled |
83
- | 2.3 | 5 | handled |
84
- | 2.3 | 5 | unhandled |
85
- | 2.4 | 5 | handled |
86
- | 2.4 | 5 | unhandled |
87
- | 2.5 | 5 | handled |
88
- | 2.5 | 5 | unhandled |
89
- | 2.5 | 6 | handled |
90
- | 2.5 | 6 | unhandled |
50
+ | route |
51
+ | handled |
52
+ | unhandled |
@@ -1,97 +1,30 @@
1
1
  Feature: Bugsnag raises errors in Sidekiq workers
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I set environment variable "APP_PATH" to "/usr/src"
6
- And I configure the bugsnag endpoint
7
-
8
- Scenario Outline: An unhandled RuntimeError sends a report
9
- And I set environment variable "RUBY_VERSION" to "<ruby version>"
10
- And I set environment variable "SIDEKIQ_VERSION" to "<sidekiq_version>"
11
- And I start the service "sidekiq"
12
- And I run the command "bundle exec ruby initializers/UnhandledError.rb" on the service "sidekiq"
13
- And I wait for 1 seconds
14
- Then I should receive a request
15
- And the request used the "Ruby Bugsnag Notifier" notifier
16
- And the request used payload v4 headers
17
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
3
+ Scenario: An unhandled RuntimeError sends a report
4
+ Given I run the service "sidekiq" with the command "bundle exec rake sidekiq_tests:unhandled_error"
5
+ And I wait to receive a request
6
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
18
7
  And the event "unhandled" is true
19
8
  And the event "severity" equals "error"
20
9
  And the event "context" equals "UnhandledError@default"
21
10
  And the event "severityReason.type" equals "unhandledExceptionMiddleware"
22
11
  And the event "severityReason.attributes.framework" equals "Sidekiq"
23
12
  And the exception "errorClass" equals "RuntimeError"
24
- And the "file" of stack frame 0 equals "/usr/src/app.rb"
13
+ And the "file" of stack frame 0 equals "/app/app.rb"
25
14
  And the "lineNumber" of stack frame 0 equals 33
26
- And the payload field "events.0.metaData.sidekiq" matches the JSON fixture in "features/fixtures/sidekiq/payloads/unhandled_metadata_ca_<created_at_present>.json"
15
+ And the payload field "events.0.metaData.sidekiq" matches the appropriate Sidekiq unhandled payload
27
16
  And the event "metaData.sidekiq.msg.created_at" is a parsable timestamp in seconds
28
17
  And the event "metaData.sidekiq.msg.enqueued_at" is a parsable timestamp in seconds
29
18
 
30
- Examples:
31
- | ruby version | sidekiq_version | created_at_present |
32
- | 1.9.3 | ~> 2 | false |
33
- | 2.0 | ~> 2 | false |
34
- | 2.0 | ~> 3 | true |
35
- | 2.1 | ~> 2 | false |
36
- | 2.1 | ~> 3 | true |
37
- | 2.2 | ~> 2 | false |
38
- | 2.2 | ~> 3 | true |
39
- | 2.2 | ~> 4 | true |
40
- | 2.2 | ~> 5 | true |
41
- | 2.3 | ~> 2 | false |
42
- | 2.3 | ~> 3 | true |
43
- | 2.3 | ~> 4 | true |
44
- | 2.3 | ~> 5 | true |
45
- | 2.4 | ~> 2 | false |
46
- | 2.4 | ~> 3 | true |
47
- | 2.4 | ~> 4 | true |
48
- | 2.4 | ~> 5 | true |
49
- | 2.5 | ~> 2 | false |
50
- | 2.5 | ~> 3 | true |
51
- | 2.5 | ~> 4 | true |
52
- | 2.5 | ~> 5 | true |
53
-
54
- Scenario Outline: A handled RuntimeError can be notified
55
- And I set environment variable "RUBY_VERSION" to "<ruby version>"
56
- And I set environment variable "SIDEKIQ_VERSION" to "<sidekiq_version>"
57
- And I start the service "sidekiq"
58
- And I run the command "bundle exec ruby initializers/HandledError.rb" on the service "sidekiq"
59
- And I wait for 1 seconds
60
- Then I should receive a request
61
- And the request used the "Ruby Bugsnag Notifier" notifier
62
- And the request used payload v4 headers
63
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
19
+ Scenario: A handled RuntimeError can be notified
20
+ Given I run the service "sidekiq" with the command "bundle exec rake sidekiq_tests:handled_error"
21
+ And I wait to receive a request
22
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
64
23
  And the event "unhandled" is false
65
24
  And the event "context" equals "HandledError@default"
66
25
  And the event "severity" equals "warning"
67
26
  And the event "severityReason.type" equals "handledException"
68
27
  And the exception "errorClass" equals "RuntimeError"
69
- And the "file" of stack frame 0 equals "/usr/src/app.rb"
70
- And the "lineNumber" of stack frame 0 equals 24
71
- And the payload field "events.0.metaData.sidekiq" matches the JSON fixture in "features/fixtures/sidekiq/payloads/handled_metadata_ca_<created_at_present>.json"
28
+ And the payload field "events.0.metaData.sidekiq" matches the appropriate Sidekiq handled payload
72
29
  And the event "metaData.sidekiq.msg.created_at" is a parsable timestamp in seconds
73
- And the event "metaData.sidekiq.msg.enqueued_at" is a parsable timestamp in seconds
74
-
75
- Examples:
76
- | ruby version | sidekiq_version | created_at_present |
77
- | 1.9.3 | ~> 2 | false |
78
- | 2.0 | ~> 2 | false |
79
- | 2.0 | ~> 3 | true |
80
- | 2.1 | ~> 2 | false |
81
- | 2.1 | ~> 3 | true |
82
- | 2.2 | ~> 2 | false |
83
- | 2.2 | ~> 3 | true |
84
- | 2.2 | ~> 4 | true |
85
- | 2.2 | ~> 5 | true |
86
- | 2.3 | ~> 2 | false |
87
- | 2.3 | ~> 3 | true |
88
- | 2.3 | ~> 4 | true |
89
- | 2.3 | ~> 5 | true |
90
- | 2.4 | ~> 2 | false |
91
- | 2.4 | ~> 3 | true |
92
- | 2.4 | ~> 4 | true |
93
- | 2.4 | ~> 5 | true |
94
- | 2.5 | ~> 2 | false |
95
- | 2.5 | ~> 3 | true |
96
- | 2.5 | ~> 4 | true |
97
- | 2.5 | ~> 5 | true |
30
+ And the event "metaData.sidekiq.msg.enqueued_at" is a parsable timestamp in seconds