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

Disable Minitest::Reporters for RubyMine #1927

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
backtrace_filter.add_filter(%r{gems/railties})
backtrace_filter.add_filter(%r{tapioca/helpers/test/})

Minitest::Reporters.use!(SpecReporter.new(color: true), ENV, backtrace_filter)
unless ENV["RM_INFO"]
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not special case RubyMine here. I'd be open to changing the default reporter, though, since our custom reporter doesn't work that well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only workaround for now, unless we don't use Minitest::Reporters at all. :(

https://blog.jetbrains.com/ruby/2021/04/improved-minitest-support-action-required/

This is a really poor DX IMO, so I opened an issue, hopefully they can address it: https://youtrack.jetbrains.com/issue/RUBY-33007/Using-Minitest-should-not-require-changes-to-testhelper.rb

Copy link
Member

Choose a reason for hiding this comment

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

Let's try not using it at all, and see what happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Left is without, right is with.

I see 2 slight benefits to using this SpecReporter:

  1. The passing tests are summarized more tersely with simple green dots (though with less detail, like the name and runtime)
  2. There's a backtrace filter applied

The stock one is more detailed, and perhaps better overall, but that's subjective

image

Minitest::Reporters.use!(SpecReporter.new(color: true), ENV, backtrace_filter)
end
Comment on lines +24 to +26
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 make this to be just:

Suggested change
unless ENV["RM_INFO"]
Minitest::Reporters.use!(SpecReporter.new(color: true), ENV, backtrace_filter)
end
Minitest.backtrace_filter = backtrace_filter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you explain the reasoning? Do we not want to use SpecReporter?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that's what I've been trying to say in the other thread:

I'd be open to changing the default reporter, though, since our custom reporter doesn't work that well.

and

Let's try not using it at all, and see what happens?


module Minitest
class Test
Expand Down
Loading