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

Use SuppressedSummaryReporter and Rails::TestUnitReporter only if needed #31901

Merged
merged 1 commit into from
Feb 17, 2018
Merged

Conversation

Kevinrob
Copy link
Contributor

@Kevinrob Kevinrob commented Feb 5, 2018

Summary

Rails Minitest plugin should add SuppressedSummaryReporter only for replacing SummaryReporter and Rails::TestUnitReporter for ProgressReporter.
Currently, the plugin always add these two reporters without checking if it's necessary.

For example, kern/minitest-reporters can remove all reporters and set custom ones defined by the configuration.
Currently, rails will re-add reporters without checks.

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @kamipo (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

@Kevinrob
Copy link
Contributor Author

Kevinrob commented Feb 5, 2018

PS: I don't find the information about which branch to target for this kind of pull request. I am sorry if it's wrong, I can change it 👍.

@y-yagi
Copy link
Member

y-yagi commented Feb 5, 2018

Thanks for your Pull Request.
Does this PR's purpose is to make it possible to invalidate reportesr provided by Rails?

@Kevinrob
Copy link
Contributor Author

Kevinrob commented Feb 6, 2018

The purpose is to make possible to replace reporters.
You can check this related issue minitest-reporters/minitest-reporters#230.
minitest-reporters allow to use other reporters like SpecReporter, ProgressReporter, RubyMineReporter.

If I understand well, Rails doesn't check and add unconditionally these two reporters. This is what I would like to change.
I think that is the initial intention when we read the comment # Replace progress reporter for colors.

The other way may be to use an ENV variable for opt-out?

@y-yagi
Copy link
Member

y-yagi commented Feb 6, 2018

Thanks. We are considering adding the option to skip Rails' custom Minitest reporter.
#30555 (comment)

Probably I think that adding this option will satisfy your request.
So let's track that PR. Thank.

@y-yagi y-yagi closed this Feb 6, 2018
@matthewd
Copy link
Member

matthewd commented Feb 6, 2018

I think that is the initial intention when we read the comment # Replace progress reporter for colors.

+1. We want to replace the original reporters; if they're not there, then we have nothing to do.

I suspect I already know the answer, but is it possible/practical to test this?

@matthewd matthewd reopened this Feb 6, 2018
@Kevinrob
Copy link
Contributor Author

Kevinrob commented Feb 6, 2018

One way for testing this is to move/extract the replacing logic to a method that take reporter as an argument and make unit test on this method. What do you think?
I will take a look at how minitest do tests. Maybe they test the plugin system.

@Kevinrob
Copy link
Contributor Author

Kevinrob commented Feb 8, 2018

I added some tests 👍

@Kevinrob
Copy link
Contributor Author

One job doesn't pass https://travis-ci.org/rails/rails/jobs/341311470

The job exceeded the maximum time limit for jobs, and has been terminated.

I don't think that I can do anything 😄

@rafaelfranca
Copy link
Member

Can you add a changelog entry and squash your commits?

@Kevinrob
Copy link
Contributor Author

@rafaelfranca I have added a changelog entry and squashed my commits 👍

@rafaelfranca rafaelfranca merged commit 7340596 into rails:master Feb 17, 2018
rafaelfranca added a commit that referenced this pull request Feb 17, 2018
Use SuppressedSummaryReporter and Rails::TestUnitReporter only if needed
rafaelfranca added a commit that referenced this pull request Feb 17, 2018
Use SuppressedSummaryReporter and Rails::TestUnitReporter only if needed
@andreynering
Copy link
Contributor

I'd be nice to have this fix backported to Rails 5.0.

@Kevinrob
Copy link
Contributor Author

Kevinrob commented Nov 4, 2019

@andreynering Is there a process or a rule for backporting this kind of fix?
I can do the PR for this with pleasure 👍

@andreynering
Copy link
Contributor

andreynering commented Nov 4, 2019

@Kevinrob Only the maintainers could tell if a backport for this would be accepted. (In theory, Rails 5.0 is not maintained anymore). If so, I'd also be open to work on this.

Do you know which version this patch was initially released for? v5.1? v5.2?

@Kevinrob
Copy link
Contributor Author

Kevinrob commented Nov 4, 2019

Rails 5.2 I thing

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.

None yet

7 participants