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

Silence Minitest for plugin tests. #17867

Merged
merged 1 commit into from
Dec 2, 2014

Conversation

tgxworld
Copy link
Contributor

@tgxworld tgxworld commented Dec 1, 2014

Fixes #17340.

Rails::BacktraceCleaner's silencers are removed to obtain the full backtrace for all libraries included in the plugin which can be helpful when debugging errors. However, we will silence traces for Minitest as it adds noise to the backtrace.

cc/ @rafaelfranca @chancancode

@@ -11,6 +11,7 @@
require "rails/test_help"

Rails.backtrace_cleaner.remove_silencers!
Rails.backtrace_cleaner.add_silencer { |line| line =~ /lib\/minitest/ }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add Minitest::BacktraceFilter?

@tgxworld tgxworld force-pushed the silence_minitest_plugins branch 2 times, most recently from ec98baf to 8b1afe1 Compare December 2, 2014 07:44
Fixes rails#17340.

Use Minitest::BacktraceFilter instead of removing all silencers. This
will allow the backtrace for all libraries in the plugin to be shown
while removing noise generated by Minitest's backtrace.
@tgxworld
Copy link
Contributor Author

tgxworld commented Dec 2, 2014

@rafaelfranca I've updated the pull request to use Minitest::BacktraceFilter. However, I feel like I'm duplicating code from here. Do you know if there is a way to identify if an app is a plugin? That way, we can avoid setting the backtrace cleaner for plugin tests.

@rafaelfranca
Copy link
Member

The only way is checking the class of Rails.application but this will load the application, so it is better to keep doing what we are doing now.

rafaelfranca added a commit that referenced this pull request Dec 2, 2014
@rafaelfranca rafaelfranca merged commit fc32d02 into rails:master Dec 2, 2014
rafaelfranca added a commit that referenced this pull request Dec 2, 2014
rafaelfranca added a commit that referenced this pull request Dec 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rails console and rake minitest issues in 4.2.0.beta2 with creating a new plugin
2 participants