Skip to content

Commit

Permalink
Add exception to active job breadcrumb in rails 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Cawllec committed Jan 6, 2025
1 parent 27bbac0 commit 99376d2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions features/rails_features/active_job.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Scenario: A handled error will be delivered
And in Rails versions ">=" 5 the event "metaData.active_job.provider_job_id" matches "^[0-9a-f-]{36}$"
And in Rails versions ">=" 5 the event "metaData.active_job.executions" equals 1
And in Rails versions ">=" 6 the event "metaData.active_job.timezone" equals "UTC"
And in Rails versions ">=" 6 the event "metaData.active_job.enqueued_at" is a timestamp
And in Rails versions ">=" 6 except 8 the event "metaData.active_job.enqueued_at" is a timestamp

@rails4 @rails5 @rails6 @rails7 @rails8
Scenario: An unhandled error will be delivered
Expand All @@ -50,7 +50,7 @@ Scenario: An unhandled error will be delivered
And in Rails versions ">=" 5 the event "metaData.active_job.provider_job_id" matches "^[0-9a-f-]{36}$"
And in Rails versions ">=" 5 the event "metaData.active_job.executions" equals 1
And in Rails versions ">=" 6 the event "metaData.active_job.timezone" equals "UTC"
And in Rails versions ">=" 6 the event "metaData.active_job.enqueued_at" is a timestamp
And in Rails versions ">=" 6 except 8 the event "metaData.active_job.enqueued_at" is a timestamp
When I discard the oldest error
Then the error is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" notifier
And the event "unhandled" is true
Expand All @@ -71,4 +71,4 @@ Scenario: An unhandled error will be delivered
And in Rails versions ">=" 5 the event "metaData.active_job.provider_job_id" matches "^[0-9a-f-]{36}$"
And in Rails versions ">=" 5 the event "metaData.active_job.executions" equals 2
And in Rails versions ">=" 6 the event "metaData.active_job.timezone" equals "UTC"
And in Rails versions ">=" 6 the event "metaData.active_job.enqueued_at" is a timestamp
And in Rails versions ">=" 6 except 8 the event "metaData.active_job.enqueued_at" is a timestamp
13 changes: 13 additions & 0 deletions features/steps/ruby_notifier_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,19 @@
end
end

Then("in Rails versions {string} {int} except {int} the event {string} is a timestamp") do |operator, version, exception, path|
skip if RAILS_FIXTURE.version_matches('==', exception)
if RAILS_FIXTURE.version_matches?(operator, version)
steps %Q{
And the event "#{path}" is a timestamp
}
else
steps %Q{
And the event "#{path}" is null
}
end
end

Then("the event {string} matches the current Que version") do |path|
# append a '.' to make this assertion stricter, e.g. if QUE_VERSION is '1'
# we'll use '1.'
Expand Down

0 comments on commit 99376d2

Please sign in to comment.