Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update maze support #496

Merged
merged 8 commits into from
Nov 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ end

group :maze, optional: true do
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner' if RUBY_VERSION >= '2.0.0'
gem 'os'
end

gemspec
19 changes: 9 additions & 10 deletions features/delayed_job.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Feature: Bugsnag detects errors in Delayed job workers

Background:
Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
And I set environment variable "MAZE_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa"
And I configure the bugsnag endpoint

Scenario: An unhandled RuntimeError sends a report with arguments
Expand All @@ -11,14 +10,14 @@ Scenario: An unhandled RuntimeError sends a report with arguments
And I run the command "bundle exec rails runner 'TestModel.delay.fail_with_args(\"Test\")'" on the service "delayed_job"
And I wait for 5 seconds
Then I should receive a request
And the request used the Ruby notifier
And the request used the "Ruby Bugsnag Notifier" notifier
And the request used payload v4 headers
And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa"
And the event "unhandled" is true
And the event "severity" is "error"
And the event "context" is "TestModel.fail_with_args"
And the event "severityReason.type" is "unhandledExceptionMiddleware"
And the event "severityReason.attributes.framework" is "DelayedJob"
And the event "severity" equals "error"
And the event "context" equals "TestModel.fail_with_args"
And the event "severityReason.type" equals "unhandledExceptionMiddleware"
And the event "severityReason.attributes.framework" equals "DelayedJob"
And the exception "errorClass" equals "RuntimeError"
And the event "metaData.job.class" equals "Delayed::Backend::ActiveRecord::Job"
And the event "metaData.job.id" is not null
Expand All @@ -35,13 +34,13 @@ Scenario: A handled exception sends a report
And I run the command "bundle exec rails runner 'TestModel.delay.notify_with_args(\"Test\")'" on the service "delayed_job"
And I wait for 5 seconds
Then I should receive a request
And the request used the Ruby notifier
And the request used the "Ruby Bugsnag Notifier" 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 "context" is "TestModel.notify_with_args"
And the event "severityReason.type" is "handledException"
And the event "severity" equals "warning"
And the event "context" equals "TestModel.notify_with_args"
And the event "severityReason.type" equals "handledException"
And the exception "errorClass" equals "RuntimeError"
And the event "metaData.job.class" equals "Delayed::Backend::ActiveRecord::Job"
And the event "metaData.job.id" is not null
Expand Down
4 changes: 2 additions & 2 deletions features/fixtures/delayed_job/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG ruby_version
FROM ruby:$ruby_version
ARG RUBY_VERSION
FROM ruby:$RUBY_VERSION

WORKDIR /bugsnag
COPY temp-bugsnag-lib ./
Expand Down
24 changes: 12 additions & 12 deletions features/fixtures/delayed_job/app/config/initializers/bugsnag.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Bugsnag.configure do |config|
config.api_key = ENV["BUGSNAG_API_KEY"] || ENV["MAZE_API_KEY"]
config.endpoint = ENV["BUGSNAG_ENDPOINT"] || ENV["MAZE_ENDPOINT"]
config.session_endpoint = ENV["BUGSNAG_ENDPOINT"] || ENV["MAZE_ENDPOINT"]
config.app_type = ENV["MAZE_APP_TYPE"] if ENV.include? "MAZE_APP_TYPE"
config.app_version = ENV["MAZE_APP_VERSION"] if ENV.include? "MAZE_APP_VERSION"
config.auto_notify = ENV["MAZE_AUTO_NOTIFY"] != "false"
config.project_root = ENV["MAZE_PROJECT_ROOT"] if ENV.include? "MAZE_PROJECT_ROOT"
config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["MAZE_IGNORE_CLASS"] } if ENV.include? "MAZE_IGNORE_CLASS"
config.auto_capture_sessions = ENV["MAZE_AUTO_CAPTURE_SESSIONS"] == "true"
config.release_stage = ENV["MAZE_RELEASE_STAGE"] if ENV.include? "MAZE_RELEASE_STAGE"
config.send_code = ENV["MAZE_SEND_CODE"] != "false"
config.send_environment = ENV["MAZE_SEND_ENVIRONMENT"] == "true"
config.api_key = ENV["BUGSNAG_API_KEY"] || ENV["BUGSNAG_API_KEY"]
config.endpoint = ENV["BUGSNAG_ENDPOINT"] || ENV["BUGSNAG_ENDPOINT"]
config.session_endpoint = ENV["BUGSNAG_ENDPOINT"] || ENV["BUGSNAG_ENDPOINT"]
config.app_type = ENV["BUGSNAG_APP_TYPE"] if ENV.include? "BUGSNAG_APP_TYPE"
config.app_version = ENV["BUGSNAG_APP_VERSION"] if ENV.include? "BUGSNAG_APP_VERSION"
config.auto_notify = ENV["BUGSNAG_AUTO_NOTIFY"] != "false"
config.project_root = ENV["BUGSNAG_PROJECT_ROOT"] if ENV.include? "BUGSNAG_PROJECT_ROOT"
config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["BUGSNAG_IGNORE_CLASS"] } if ENV.include? "BUGSNAG_IGNORE_CLASS"
config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true"
config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] if ENV.include? "BUGSNAG_RELEASE_STAGE"
config.send_code = ENV["BUGSNAG_SEND_CODE"] != "false"
config.send_environment = ENV["BUGSNAG_SEND_ENVIRONMENT"] == "true"
end
Loading