-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made test repeatability more consistent, added handled feature
- Loading branch information
Showing
22 changed files
with
187 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,3 +50,6 @@ vendor | |
# For rubinius: | ||
#*.rbc | ||
bin | ||
|
||
# For Bugsnag-Maze-Runner: | ||
maze_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Gemfile.lock | ||
requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require './app' | ||
|
||
class SkippableError < RuntimeError | ||
attr_accessor :skip_bugsnag | ||
end | ||
|
||
begin | ||
raise SkippableError.new("NotifyException") | ||
rescue => exception | ||
exception.skip_bugsnag = true | ||
Bugsnag.notify(exception) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require './app' | ||
|
||
configure_basics | ||
|
||
begin | ||
raise RuntimeError.new("NotifyException") | ||
rescue => exception | ||
Bugsnag.notify(exception) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require './app' | ||
|
||
configure_basics | ||
|
||
begin | ||
raise RuntimeError.new("NotifyException") | ||
rescue => exception | ||
Bugsnag.notify("NotifyString") | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Feature: Plain handled errors | ||
|
||
Background: | ||
Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" | ||
And I set environment variable "MAZE_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" | ||
And I set environment variable "APP_PATH" to "/usr/src" | ||
And I configure the bugsnag endpoint | ||
|
||
Scenario Outline: A handled error sends a report | ||
And I set environment variable "RUBY_VERSION" to "<ruby version>" | ||
And I build the service "plain-ruby" from the compose file "features/fixtures/plain/docker-compose.yml" | ||
And I run the command "plain-ruby bundle exec ruby handled/<file>.rb" on the service "features/fixtures/plain/docker-compose.yml" | ||
And I wait for 1 second | ||
Then I should receive a request | ||
And the request used the Ruby notifier | ||
And the request used payload v4 headers | ||
And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa" | ||
And the event "unhandled" is false | ||
And the event "severity" is "warning" | ||
And the event "severityReason.type" is "handledException" | ||
And the exception "errorClass" equals "RuntimeError" | ||
And the "file" of stack frame 0 equals "/usr/src/handled/<file>.rb" | ||
And the "lineNumber" of stack frame 0 equals <lineNumber> | ||
|
||
Examples: | ||
| ruby version | file | lineNumber | | ||
| 1.9.3 | NotifyException | 6 | | ||
| 1.9.3 | NotifyString | 8 | | ||
| 2.0 | NotifyException | 6 | | ||
| 2.0 | NotifyString | 8 | | ||
| 2.1 | NotifyException | 6 | | ||
| 2.1 | NotifyString | 8 | | ||
| 2.2 | NotifyException | 6 | | ||
| 2.2 | NotifyString | 8 | | ||
| 2.3 | NotifyException | 6 | | ||
| 2.3 | NotifyString | 8 | | ||
| 2.4 | NotifyException | 6 | | ||
| 2.4 | NotifyString | 8 | | ||
| 2.5 | NotifyException | 6 | | ||
| 2.5 | NotifyString | 8 | | ||
|
||
Scenario Outline: A handled error doesn't send a report when the :skip_bugsnag flag is set | ||
And I set environment variable "ruby_version" to "<ruby version>" | ||
And I build the service "plain-ruby" from the compose file "features/fixtures/plain/docker-compose.yml" | ||
And I run the command "plain-ruby bundle exec ruby unhandled/IgnoreException.rb" on the service "features/fixtures/plain/docker-compose.yml" | ||
And I wait for 1 second | ||
Then I should receive 0 requests | ||
|
||
Examples: | ||
| ruby version | | ||
| 1.9.3 | | ||
| 2.0 | | ||
| 2.1 | | ||
| 2.2 | | ||
| 2.3 | | ||
| 2.4 | | ||
| 2.5 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters