-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Plagiarise Cucumber-JS's formatter summary #1030
Comments
@mattwynne Thanks! sounds good I will pick this up |
👍 |
A question here is whether if it really is the job of the formatter to print the summary, snippets etc., not the least when considering it from the perspective of the future cross-platform formatters. In Cucumber-JVM the summary, snippets etc. is not printed by formatters, but by a separate summary plugin. Currently there are two built in summary plugins, the The differentiating question here is, if someone were to (with the The printing of the summary in Cucumber-JVM was actually one of the things a did in the Cucumber-JVM code base, with the strict instruction that it "should not be part of the formatter, but rather be implemented close to where snippets are printed". |
I've started extracting a couple of things a bit like you describe here @brasmusson, see https://github.com/cucumber/cucumber-ruby/blob/master/lib/cucumber/formatter/console_counts.rb for example. I'm ambivalent about whether they're part of the formatters or not in the end, but I do think we should break these things up, and use composition rather than inheritance. The |
It's a good point @brasmusson. I have just started working on this and I think that separating the logic which prints the summary and the formatter will bring more flexibility and clean code. @mattwynne if you agree I would try to refactor this as part of this PR. What do you think? |
@nodo I think that refactoring the console formatter code to make it more modular would be an excellent plan. You might want to do it separately as a "pre-factoring" and then do this work on top of that. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Cucumber-JS recently added a very nice summary output that lists all the issues found during a test run. Most other testing tools (mocha, rspec) do something similar.
I'd like to converge on what Cucumber-JS is doing, and print this summary at the bottom of all of our console formatters.
Expected Behavior
@charlierudolph who wrote this feature into Cucumber-JS tells me that it's not all that well documented in their tests, but there are clues:
Current Behaviour
The formatters are inconsistent at the moment. This is a chance to bring all the console formatters into line.
Possible Solution
Historically, the console formatters used inheritance, using the
Cucumber::Formatter::Console
module to bring in this kind of functionality. That module got big and unwieldy, and I've recently done some refactoring to use composition instead, extracting out theCucumber::Formatter::ConsoleCounts
andCucumber::Formatter::ConsoleIssues
classes.A suggested solution would be to rename
ConsoleIssues
toConsoleRerunSuggestions
or similar (because that's actually what it does) and build a newConsoleIssues
that prints the issues list in the same way as Cucumber-JS does.Context & Motivation
Although the long-term plan is to build a central library of cross-platform formatters, that's a while off. This should be a relatively easy / quick implementation, and should improve the user experience.
The text was updated successfully, but these errors were encountered: