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

Conversation

amomchilov
Copy link
Contributor

@amomchilov amomchilov commented Jun 17, 2024

Workaround for this issue.

@amomchilov amomchilov requested a review from a team as a code owner June 17, 2024 13:32
@andyw8
Copy link
Contributor

andyw8 commented Jun 17, 2024

I think this the git stuff is better suited for people's personal ~/.gitignore.

.gitignore Outdated
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
Copy link
Member

Choose a reason for hiding this comment

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

I think we'd rather just ignore the whole .idea folder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think I should do that here at all, or leave it to each dev to configure as @andyw8 suggested?

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -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

@amomchilov amomchilov changed the title Ignore RubyMine files, and skip Minitest::Reporters Disable Minitest::Reporters for RubyMine Jun 18, 2024
Comment on lines +24 to +26
unless ENV["RM_INFO"]
Minitest::Reporters.use!(SpecReporter.new(color: true), ENV, backtrace_filter)
end
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?

@KaanOzkan KaanOzkan removed their request for review November 25, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants