bugsnag 6.12.0 → 6.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) 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 +67 -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 +28 -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/unhandled/{Interrupt.rb → interrupt.rb} +0 -0
  31. data/features/fixtures/rack1/Dockerfile +2 -2
  32. data/features/fixtures/rack2/Dockerfile +2 -2
  33. data/features/fixtures/rails3/Dockerfile +2 -2
  34. data/features/fixtures/rails3/app/Gemfile +4 -0
  35. data/features/fixtures/rails3/app/config/initializers/bugsnag.rb +3 -2
  36. data/features/fixtures/rails4/Dockerfile +2 -5
  37. data/features/fixtures/rails4/app/config/initializers/bugsnag.rb +2 -1
  38. data/features/fixtures/rails5/Dockerfile +2 -2
  39. data/features/fixtures/rails5/app/Gemfile +3 -2
  40. data/features/fixtures/rails5/app/config/initializers/bugsnag.rb +2 -1
  41. data/features/fixtures/rails6/Dockerfile +2 -2
  42. data/features/fixtures/rails6/app/Gemfile +3 -2
  43. data/features/fixtures/rails6/app/app/controllers/mongo_controller.rb +22 -0
  44. data/features/fixtures/rails6/app/app/models/mongo_model.rb +6 -0
  45. data/features/fixtures/rails6/app/config/environments/development.rb +2 -0
  46. data/features/fixtures/rails6/app/config/environments/production.rb +1 -0
  47. data/features/fixtures/rails6/app/config/environments/rails_env.rb +1 -0
  48. data/features/fixtures/rails6/app/config/environments/test.rb +1 -0
  49. data/features/fixtures/rails6/app/config/initializers/bugsnag.rb +2 -1
  50. data/features/fixtures/rails6/app/config/mongoid.yml +23 -0
  51. data/features/fixtures/rails6/app/config/routes.rb +4 -0
  52. data/features/fixtures/resque/Dockerfile +2 -2
  53. data/features/fixtures/sidekiq/Dockerfile +5 -7
  54. data/features/fixtures/sidekiq/app/Gemfile +2 -1
  55. data/features/fixtures/sidekiq/app/Rakefile.rb +14 -0
  56. data/features/fixtures/sinatra1/Dockerfile +2 -2
  57. data/features/fixtures/sinatra2/Dockerfile +2 -2
  58. data/features/plain_features/add_tab.feature +24 -97
  59. data/features/plain_features/app_type.feature +6 -25
  60. data/features/plain_features/app_version.feature +6 -25
  61. data/features/plain_features/auto_notify.feature +4 -20
  62. data/features/plain_features/delivery.feature +12 -60
  63. data/features/plain_features/exception_data.feature +24 -94
  64. data/features/plain_features/filters.feature +9 -43
  65. data/features/plain_features/handled_errors.feature +16 -78
  66. data/features/plain_features/ignore_classes.feature +5 -23
  67. data/features/plain_features/ignore_report.feature +6 -24
  68. data/features/plain_features/proxies.feature +13 -56
  69. data/features/plain_features/release_stages.feature +9 -40
  70. data/features/plain_features/report_api_key.feature +9 -35
  71. data/features/plain_features/report_severity.feature +8 -35
  72. data/features/plain_features/report_stack_frames.feature +24 -92
  73. data/features/plain_features/report_user.feature +23 -96
  74. data/features/plain_features/unhandled_errors.feature +17 -88
  75. data/features/rails_features/api_key.feature +12 -58
  76. data/features/rails_features/app_type.feature +13 -58
  77. data/features/rails_features/app_version.feature +19 -80
  78. data/features/rails_features/auto_capture_sessions.feature +31 -112
  79. data/features/rails_features/auto_notify.feature +28 -105
  80. data/features/rails_features/before_notify.feature +18 -83
  81. data/features/rails_features/breadcrumbs.feature +40 -137
  82. data/features/rails_features/handled.feature +18 -82
  83. data/features/rails_features/ignore_classes.feature +12 -51
  84. data/features/rails_features/meta_data_filters.feature +9 -33
  85. data/features/rails_features/mongo_breadcrumbs.feature +22 -96
  86. data/features/rails_features/project_root.feature +19 -84
  87. data/features/rails_features/release_stage.feature +20 -82
  88. data/features/rails_features/send_code.feature +13 -55
  89. data/features/rails_features/send_environment.feature +7 -33
  90. data/features/rails_features/unhandled.feature +6 -31
  91. data/features/rails_features/user_info.feature +27 -65
  92. data/features/sidekiq.feature +12 -79
  93. data/features/steps/ruby_notifier_steps.rb +59 -15
  94. data/features/support/env.rb +12 -45
  95. data/lib/bugsnag.rb +74 -21
  96. data/lib/bugsnag/breadcrumbs/breadcrumbs.rb +0 -2
  97. data/lib/bugsnag/breadcrumbs/validator.rb +0 -6
  98. data/lib/bugsnag/cleaner.rb +129 -60
  99. data/lib/bugsnag/configuration.rb +31 -2
  100. data/lib/bugsnag/helpers.rb +2 -4
  101. data/lib/bugsnag/integrations/que.rb +7 -4
  102. data/lib/bugsnag/integrations/railtie.rb +1 -1
  103. data/lib/bugsnag/middleware/discard_error_class.rb +30 -0
  104. data/lib/bugsnag/middleware/exception_meta_data.rb +15 -9
  105. data/lib/bugsnag/middleware/ignore_error_class.rb +2 -0
  106. data/lib/bugsnag/middleware/rack_request.rb +2 -4
  107. data/lib/bugsnag/report.rb +3 -13
  108. data/lib/bugsnag/stacktrace.rb +6 -10
  109. data/spec/breadcrumbs/breadcrumb_spec.rb +1 -1
  110. data/spec/breadcrumbs/validator_spec.rb +1 -26
  111. data/spec/bugsnag_spec.rb +2 -2
  112. data/spec/cleaner_spec.rb +202 -10
  113. data/spec/configuration_spec.rb +16 -1
  114. data/spec/fixtures/apps/rails-initializer-config/Gemfile +5 -1
  115. data/spec/fixtures/apps/rails-invalid-initializer-config/Gemfile +5 -1
  116. data/spec/fixtures/apps/rails-no-config/Gemfile +5 -1
  117. data/spec/helper_spec.rb +0 -31
  118. data/spec/integrations/logger_spec.rb +1 -1
  119. data/spec/integrations/rack_spec.rb +8 -6
  120. data/spec/integrations/rake_spec.rb +1 -1
  121. data/spec/report_spec.rb +324 -26
  122. data/spec/spec_helper.rb +6 -1
  123. data/spec/stacktrace_spec.rb +179 -72
  124. metadata +23 -7
  125. data/.travis.yml +0 -117
  126. data/features/plain_features/api_key.feature +0 -25
@@ -1,48 +1,14 @@
1
1
  Feature: Plain filtering of metadata
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I configure the bugsnag endpoint
6
-
7
- Scenario Outline: Metadata is filtered through the default filters
8
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
9
- And I have built the service "plain-ruby"
10
- And I run the service "plain-ruby" with the command "bundle exec ruby filters/default_filters.rb"
11
- And I wait for 1 second
12
- Then I should receive a request
13
- And the request used the "Ruby Bugsnag Notifier" notifier
14
- And the request used payload v4 headers
15
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
3
+ Scenario: Metadata is filtered through the default filters
4
+ When I run the service "plain-ruby" with the command "bundle exec ruby filters/default_filters.rb"
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"
16
7
  And the event "metaData.filter" matches the JSON fixture in "features/fixtures/plain/json/filters_default_metadata_filters.json"
17
8
 
18
- Examples:
19
- | ruby version |
20
- | 1.9.3 |
21
- | 2.0 |
22
- | 2.1 |
23
- | 2.2 |
24
- | 2.3 |
25
- | 2.4 |
26
- | 2.5 |
27
-
28
- Scenario Outline: Additional filters can be added to the filter list
29
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
30
- And I set environment variable "BUGSNAG_META_DATA_FILTERS" to "filter_me"
31
- And I have built the service "plain-ruby"
32
- And I run the service "plain-ruby" with the command "bundle exec ruby filters/additional_filters.rb"
33
- And I wait for 1 second
34
- Then I should receive a request
35
- And the request used the "Ruby Bugsnag Notifier" notifier
36
- And the request used payload v4 headers
37
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
9
+ Scenario: Additional filters can be added to the filter list
10
+ Given I set environment variable "BUGSNAG_META_DATA_FILTERS" to "filter_me"
11
+ When I run the service "plain-ruby" with the command "bundle exec ruby filters/additional_filters.rb"
12
+ And I wait to receive a request
13
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
38
14
  And the event "metaData.filter.filter_me" equals "[FILTERED]"
39
-
40
- Examples:
41
- | ruby version |
42
- | 1.9.3 |
43
- | 2.0 |
44
- | 2.1 |
45
- | 2.2 |
46
- | 2.3 |
47
- | 2.4 |
48
- | 2.5 |
@@ -1,18 +1,9 @@
1
1
  Feature: Plain handled errors
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I configure the bugsnag endpoint
6
-
7
- Scenario Outline: A rescued exception sends a report
8
- And I set environment variable "RUBY_VERSION" to "<ruby version>"
9
- And I have built the service "plain-ruby"
10
- And I run the service "plain-ruby" with the command "bundle exec ruby handled/notify_exception.rb"
11
- And I wait for 1 second
12
- Then I should receive a request
13
- And the request used the "Ruby Bugsnag Notifier" notifier
14
- And the request used payload v4 headers
15
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
3
+ Scenario: A rescued exception sends a report
4
+ When I run the service "plain-ruby" with the command "bundle exec ruby handled/notify_exception.rb"
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"
16
7
  And the event "unhandled" is false
17
8
  And the event "severity" equals "warning"
18
9
  And the event "severityReason.type" equals "handledException"
@@ -20,25 +11,10 @@ Scenario Outline: A rescued exception sends a report
20
11
  And the "file" of stack frame 0 equals "/usr/src/app/handled/notify_exception.rb"
21
12
  And the "lineNumber" of stack frame 0 equals 6
22
13
 
23
- Examples:
24
- | ruby version |
25
- | 1.9.3 |
26
- | 2.0 |
27
- | 2.1 |
28
- | 2.2 |
29
- | 2.3 |
30
- | 2.4 |
31
- | 2.5 |
32
-
33
- Scenario Outline: A notified string sends a report
34
- And I set environment variable "RUBY_VERSION" to "<ruby version>"
35
- And I have built the service "plain-ruby"
36
- And I run the service "plain-ruby" with the command "bundle exec ruby handled/notify_string.rb"
37
- And I wait for 1 second
38
- Then I should receive a request
39
- And the request used the "Ruby Bugsnag Notifier" notifier
40
- And the request used payload v4 headers
41
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
14
+ Scenario: A notified string sends a report
15
+ When I run the service "plain-ruby" with the command "bundle exec ruby handled/notify_string.rb"
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"
42
18
  And the event "unhandled" is false
43
19
  And the event "severity" equals "warning"
44
20
  And the event "severityReason.type" equals "handledException"
@@ -46,43 +22,15 @@ Scenario Outline: A notified string sends a report
46
22
  And the "file" of the top non-bugsnag stackframe equals "/usr/src/app/handled/notify_string.rb"
47
23
  And the "lineNumber" of the top non-bugsnag stackframe equals 8
48
24
 
49
- Examples:
50
- | ruby version |
51
- | 1.9.3 |
52
- | 2.0 |
53
- | 2.1 |
54
- | 2.2 |
55
- | 2.3 |
56
- | 2.4 |
57
- | 2.5 |
58
-
59
-
60
- Scenario Outline: A handled error doesn't send a report when the :skip_bugsnag flag is set
61
- And I set environment variable "RUBY_VERSION" to "<ruby version>"
62
- And I have built the service "plain-ruby"
63
- And I run the service "plain-ruby" with the command "bundle exec ruby handled/ignore_exception.rb"
25
+ Scenario: A handled error doesn't send a report when the :skip_bugsnag flag is set
26
+ When I run the service "plain-ruby" with the command "bundle exec ruby handled/ignore_exception.rb"
64
27
  And I wait for 1 second
65
- Then I should receive 0 requests
66
-
67
- Examples:
68
- | ruby version |
69
- | 1.9.3 |
70
- | 2.0 |
71
- | 2.1 |
72
- | 2.2 |
73
- | 2.3 |
74
- | 2.4 |
75
- | 2.5 |
28
+ Then I should receive no requests
76
29
 
77
- Scenario Outline: A handled error can attach metadata in a block
78
- And I set environment variable "RUBY_VERSION" to "<ruby version>"
79
- And I have built the service "plain-ruby"
80
- And I run the service "plain-ruby" with the command "bundle exec ruby handled/block_metadata.rb"
81
- And I wait for 1 second
82
- Then I should receive a request
83
- And the request used the "Ruby Bugsnag Notifier" notifier
84
- And the request used payload v4 headers
85
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
30
+ Scenario: A handled error can attach metadata in a block
31
+ When I run the service "plain-ruby" with the command "bundle exec ruby handled/block_metadata.rb"
32
+ And I wait to receive a request
33
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
86
34
  And the event "unhandled" is false
87
35
  And the event "severity" equals "warning"
88
36
  And the event "severityReason.type" equals "handledException"
@@ -91,14 +39,4 @@ Scenario Outline: A handled error can attach metadata in a block
91
39
  And the "lineNumber" of stack frame 0 equals 6
92
40
  And the event "metaData.account.id" equals "1234abcd"
93
41
  And the event "metaData.account.name" equals "Acme Co"
94
- And the event "metaData.account.support" is true
95
-
96
- Examples:
97
- | ruby version |
98
- | 1.9.3 |
99
- | 2.0 |
100
- | 2.1 |
101
- | 2.2 |
102
- | 2.3 |
103
- | 2.4 |
104
- | 2.5 |
42
+ And the event "metaData.account.support" is true
@@ -1,29 +1,11 @@
1
1
  Feature: Plain ignore classes
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I configure the bugsnag endpoint
6
-
7
3
  Scenario Outline: An errors class is in the ignore_classes array
8
- And I set environment variable "RUBY_VERSION" to "<ruby version>"
9
- And I have built the service "plain-ruby"
10
- And I run the service "plain-ruby" with the command "bundle exec ruby ignore_classes/<state>.rb"
4
+ When I run the service "plain-ruby" with the command "bundle exec ruby ignore_classes/<state>.rb"
11
5
  And I wait for 1 second
12
- Then I should receive 0 requests
6
+ Then I should receive no requests
13
7
 
14
8
  Examples:
15
- | ruby version | state |
16
- | 1.9.3 | unhandled |
17
- | 1.9.3 | handled |
18
- | 2.0 | unhandled |
19
- | 2.0 | handled |
20
- | 2.1 | unhandled |
21
- | 2.1 | handled |
22
- | 2.2 | unhandled |
23
- | 2.2 | handled |
24
- | 2.3 | unhandled |
25
- | 2.3 | handled |
26
- | 2.4 | unhandled |
27
- | 2.4 | handled |
28
- | 2.5 | unhandled |
29
- | 2.5 | handled |
9
+ | state |
10
+ | unhandled |
11
+ | handled |
@@ -1,30 +1,12 @@
1
1
  Feature: Plain ignore report
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I configure the bugsnag endpoint
6
-
7
3
  Scenario Outline: A reports severity can be modified
8
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
9
- And I set environment variable "CALLBACK_INITIATOR" to "<initiator>"
10
- And I have built the service "plain-ruby"
11
- And I run the service "plain-ruby" with the command "bundle exec ruby report_modification/ignore_report.rb"
4
+ Given I set environment variable "CALLBACK_INITIATOR" to "<initiator>"
5
+ When I run the service "plain-ruby" with the command "bundle exec ruby report_modification/ignore_report.rb"
12
6
  And I wait for 1 second
13
- Then I should receive 0 requests
7
+ Then I should receive no requests
14
8
 
15
9
  Examples:
16
- | ruby version | initiator |
17
- | 1.9.3 | handled_before_notify |
18
- | 1.9.3 | unhandled_before_notify |
19
- | 2.0 | handled_before_notify |
20
- | 2.0 | unhandled_before_notify |
21
- | 2.1 | handled_before_notify |
22
- | 2.1 | unhandled_before_notify |
23
- | 2.2 | handled_before_notify |
24
- | 2.2 | unhandled_before_notify |
25
- | 2.3 | handled_before_notify |
26
- | 2.3 | unhandled_before_notify |
27
- | 2.4 | handled_before_notify |
28
- | 2.4 | unhandled_before_notify |
29
- | 2.5 | handled_before_notify |
30
- | 2.5 | unhandled_before_notify |
10
+ | initiator |
11
+ | handled_before_notify |
12
+ | unhandled_before_notify |
@@ -1,68 +1,25 @@
1
1
  Feature: proxy configuration options
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I configure the bugsnag endpoint
6
-
7
- Scenario Outline: Proxy settings are provided as configuration options
8
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
9
- And I set environment variable "BUGSNAG_PROXY_HOST" to the current IP
10
- And I set environment variable "BUGSNAG_PROXY_PORT" to the mock API port
3
+ Scenario: Proxy settings are provided as configuration options
4
+ When I set environment variable "BUGSNAG_PROXY_HOST" to "maze-runner"
5
+ And I set environment variable "BUGSNAG_PROXY_PORT" to "9339"
11
6
  And I set environment variable "BUGSNAG_PROXY_USER" to "tester"
12
7
  And I set environment variable "BUGSNAG_PROXY_PASSWORD" to "testpass"
13
- And I have built the service "plain-ruby"
14
- And I run the service "plain-ruby" with the command "bundle exec ruby configuration/proxy.rb"
15
- And I wait for 1 second
16
- Then I should receive a request
8
+ When I run the service "plain-ruby" with the command "bundle exec ruby configuration/proxy.rb"
9
+ Then I wait to receive a request
17
10
  And the "proxy-authorization" header equals "Basic dGVzdGVyOnRlc3RwYXNz"
18
11
  And the event "metaData.proxy.user" equals "tester"
19
12
 
20
- Examples:
21
- | ruby version |
22
- | 1.9.3 |
23
- | 2.0 |
24
- | 2.1 |
25
- | 2.2 |
26
- | 2.3 |
27
- | 2.4 |
28
- | 2.5 |
29
-
30
- Scenario Outline: Proxy settings are provided as the HTTP_PROXY environment variable
31
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
32
- And I set environment variable "http_proxy" to the proxy settings with credentials "http://tester:testpass"
33
- And I have built the service "plain-ruby"
34
- And I run the service "plain-ruby" with the command "bundle exec ruby configuration/proxy.rb"
35
- And I wait for 1 second
36
- Then I should receive a request
13
+ Scenario: Proxy settings are provided as the HTTP_PROXY environment variable
14
+ Given I set environment variable "http_proxy" to "http://tester:testpass@maze-runner:9339"
15
+ When I run the service "plain-ruby" with the command "bundle exec ruby configuration/proxy.rb"
16
+ Then I wait to receive a request
37
17
  And the "proxy-authorization" header equals "Basic dGVzdGVyOnRlc3RwYXNz"
38
18
  And the event "metaData.proxy.user" equals "tester"
39
19
 
40
- Examples:
41
- | ruby version |
42
- | 1.9.3 |
43
- | 2.0 |
44
- | 2.1 |
45
- | 2.2 |
46
- | 2.3 |
47
- | 2.4 |
48
- | 2.5 |
49
-
50
- Scenario Outline: Proxy settings are provided as the HTTPS_PROXY environment variable
51
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
52
- And I set environment variable "https_proxy" to the proxy settings with credentials "https://tester:testpass"
53
- And I have built the service "plain-ruby"
54
- And I run the service "plain-ruby" with the command "bundle exec ruby configuration/proxy.rb"
55
- And I wait for 1 second
56
- Then I should receive a request
20
+ Scenario: Proxy settings are provided as the HTTPS_PROXY environment variable
21
+ Given I set environment variable "https_proxy" to "http://tester:testpass@maze-runner:9339"
22
+ When I run the service "plain-ruby" with the command "bundle exec ruby configuration/proxy.rb"
23
+ Then I wait to receive a request
57
24
  And the "proxy-authorization" header equals "Basic dGVzdGVyOnRlc3RwYXNz"
58
25
  And the event "metaData.proxy.user" equals "tester"
59
-
60
- Examples:
61
- | ruby version |
62
- | 1.9.3 |
63
- | 2.0 |
64
- | 2.1 |
65
- | 2.2 |
66
- | 2.3 |
67
- | 2.4 |
68
- | 2.5 |
@@ -1,51 +1,20 @@
1
1
  Feature: Release stage configuration options
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I configure the bugsnag endpoint
6
-
7
- Scenario Outline: Doesn't notify in the wrong release stage
8
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
9
- And I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGE" to "stage_one"
3
+ Scenario: Doesn't notify in the wrong release stage
4
+ Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGE" to "stage_one"
10
5
  And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage_two"
11
- And I have built the service "plain-ruby"
12
- And I run the service "plain-ruby" with the command "bundle exec ruby configuration/send_unhandled.rb"
6
+ When I run the service "plain-ruby" with the command "bundle exec ruby configuration/send_unhandled.rb"
13
7
  And I wait for 1 second
14
- Then I should receive 0 requests
15
-
16
- Examples:
17
- | ruby version |
18
- | 1.9.3 |
19
- | 2.0 |
20
- | 2.1 |
21
- | 2.2 |
22
- | 2.3 |
23
- | 2.4 |
24
- | 2.5 |
8
+ Then I should receive no requests
25
9
 
26
- Scenario Outline: Doesn't notify in the wrong release stage
27
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
28
- And I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGE" to "stage_one"
10
+ Scenario: Does notify in the correct release stage
11
+ Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGE" to "stage_one"
29
12
  And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage_one"
30
- And I have built the service "plain-ruby"
31
- And I run the service "plain-ruby" with the command "bundle exec ruby configuration/send_unhandled.rb"
32
- And I wait for 1 second
33
- Then I should receive a request
34
- And the request used the "Ruby Bugsnag Notifier" notifier
35
- And the request used payload v4 headers
36
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
13
+ When I run the service "plain-ruby" with the command "bundle exec ruby configuration/send_unhandled.rb"
14
+ And I wait to receive a request
15
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
37
16
  And the event "unhandled" is true
38
17
  And the event "severity" equals "error"
39
18
  And the event "severityReason.type" equals "unhandledException"
40
19
  And the exception "errorClass" equals "RuntimeError"
41
20
  And the "file" of stack frame 0 equals "/usr/src/app/configuration/send_unhandled.rb"
42
-
43
- Examples:
44
- | ruby version |
45
- | 1.9.3 |
46
- | 2.0 |
47
- | 2.1 |
48
- | 2.2 |
49
- | 2.3 |
50
- | 2.4 |
51
- | 2.5 |
@@ -1,40 +1,14 @@
1
1
  Feature: Plain report modify api key
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I configure the bugsnag endpoint
6
-
7
3
  Scenario Outline: A report can have its api_key modified
8
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
9
- And I set environment variable "CALLBACK_INITIATOR" to "<initiator>"
10
- And I have built the service "plain-ruby"
11
- And I run the service "plain-ruby" with the command "bundle exec ruby report_modification/modify_api_key.rb"
12
- And I wait for 1 second
13
- Then I should receive a request
14
- And the request used the "Ruby Bugsnag Notifier" notifier
15
- And the request used payload v4 headers
16
- And the request contained the api key "abcdefghijklmnopqrstuvwxyz123456"
4
+ Given I set environment variable "CALLBACK_INITIATOR" to "<initiator>"
5
+ When I run the service "plain-ruby" with the command "bundle exec ruby report_modification/modify_api_key.rb"
6
+ And I wait to receive a request
7
+ Then the "Bugsnag-Api-Key" header equals "abcdefghijklmnopqrstuvwxyz123456"
8
+ And the payload field "apiKey" equals "abcdefghijklmnopqrstuvwxyz123456"
17
9
 
18
10
  Examples:
19
- | ruby version | initiator |
20
- | 1.9.3 | handled_before_notify |
21
- | 1.9.3 | handled_block |
22
- | 1.9.3 | unhandled_before_notify |
23
- | 2.0 | handled_before_notify |
24
- | 2.0 | handled_block |
25
- | 2.0 | unhandled_before_notify |
26
- | 2.1 | handled_before_notify |
27
- | 2.1 | handled_block |
28
- | 2.1 | unhandled_before_notify |
29
- | 2.2 | handled_before_notify |
30
- | 2.2 | handled_block |
31
- | 2.2 | unhandled_before_notify |
32
- | 2.3 | handled_before_notify |
33
- | 2.3 | handled_block |
34
- | 2.3 | unhandled_before_notify |
35
- | 2.4 | handled_before_notify |
36
- | 2.4 | handled_block |
37
- | 2.4 | unhandled_before_notify |
38
- | 2.5 | handled_before_notify |
39
- | 2.5 | handled_block |
40
- | 2.5 | unhandled_before_notify |
11
+ | initiator |
12
+ | handled_before_notify |
13
+ | handled_block |
14
+ | unhandled_before_notify |
@@ -1,42 +1,15 @@
1
1
  Feature: Plain report modify severity
2
2
 
3
- Background:
4
- Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
5
- And I configure the bugsnag endpoint
6
-
7
3
  Scenario Outline: A reports severity can be modified
8
- Given I set environment variable "RUBY_VERSION" to "<ruby version>"
9
- And I set environment variable "CALLBACK_INITIATOR" to "<initiator>"
10
- And I have built the service "plain-ruby"
11
- And I run the service "plain-ruby" with the command "bundle exec ruby report_modification/modify_severity.rb"
12
- And I wait for 1 second
13
- Then I should receive a request
14
- And the request used the "Ruby Bugsnag Notifier" notifier
15
- And the request used payload v4 headers
16
- And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
4
+ Given I set environment variable "CALLBACK_INITIATOR" to "<initiator>"
5
+ When I run the service "plain-ruby" with the command "bundle exec ruby report_modification/modify_severity.rb"
6
+ And I wait to receive a request
7
+ Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier"
17
8
  And the event "severity" equals "info"
18
9
  And the event "severityReason.type" equals "userCallbackSetSeverity"
19
10
 
20
11
  Examples:
21
- | ruby version | initiator |
22
- | 1.9.3 | handled_before_notify |
23
- | 1.9.3 | handled_block |
24
- | 1.9.3 | unhandled_before_notify |
25
- | 2.0 | handled_before_notify |
26
- | 2.0 | handled_block |
27
- | 2.0 | unhandled_before_notify |
28
- | 2.1 | handled_before_notify |
29
- | 2.1 | handled_block |
30
- | 2.1 | unhandled_before_notify |
31
- | 2.2 | handled_before_notify |
32
- | 2.2 | handled_block |
33
- | 2.2 | unhandled_before_notify |
34
- | 2.3 | handled_before_notify |
35
- | 2.3 | handled_block |
36
- | 2.3 | unhandled_before_notify |
37
- | 2.4 | handled_before_notify |
38
- | 2.4 | handled_block |
39
- | 2.4 | unhandled_before_notify |
40
- | 2.5 | handled_before_notify |
41
- | 2.5 | handled_block |
42
- | 2.5 | unhandled_before_notify |
12
+ | initiator |
13
+ | handled_before_notify |
14
+ | handled_block |
15
+ | unhandled_before_notify |