-
Notifications
You must be signed in to change notification settings - Fork 600
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
Active Job notifications subscriber #1761
Conversation
Subscribe to Active Job notifications and process the 7 (at the time of Rails v7.1.0.0.alpha) related events to produce additional instrumentation for the library.
@@ -7,4 +7,11 @@ | |||
# required Ruby >= 2.5.0 and Ruby 2.6.0 was marked for EOL | |||
SIMPLECOV_MIN_RUBY_VERSION = '2.7.0' | |||
|
|||
require 'simplecov' if RUBY_VERSION >= SIMPLECOV_MIN_RUBY_VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently for some tests with some Rubies, we hit a "file not found" error, which can be puzzling because it's not obvious that there's a LoadError involved (no backtrace is provided) and passing things such as --trace
won't reach the subshell used for the env tests.
To repro, simply use Ruby 2.7.5 to perform bundle exec rake test:env[rails52]
. It's perfectly reasonable that Ruby 2.7.5 might be used in conjunction with Rails 5.2. But while Ruby 2.7+ will satisfy the SimpleCov helper check, the Rails 5.2 test env Gemfile
does not specify simplecov
.
Now we simply rescue and report load errors but don't let them stop the tests from running.
test/new_relic/agent/instrumentation/rails/active_job_subscriber.rb
Outdated
Show resolved
Hide resolved
test/new_relic/agent/instrumentation/rails/active_job_subscriber.rb
Outdated
Show resolved
Hide resolved
test/new_relic/agent/instrumentation/rails/active_job_subscriber.rb
Outdated
Show resolved
Hide resolved
- leverage the base NotificationsSubscriber class better - standardize on NewRelic::UNKNOWN - update test names - simplify TODO comment
SimpleCov Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, James!
Subscribe to Active Job notifications and process the 7 (at the time of Rails v7.1.0.0.alpha) related events to produce additional instrumentation for the library.
resolves #1515