-
-
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
Summary formatter #999
Summary formatter #999
Conversation
This formatter provides a high-level summary of the scenarios that were run. It's also A LOT simpler than the pretty formatter, and so more reliable for testing with. I'm thinking we can use this to build out alternative re-usable pieces (like the summary) that need to be re-written anyway. Work still to do: - unit tests - acceptance test for scenario outlines - finish the summary - colours? - some animation as steps run?
Still to do: - unit tests - useful output when tests fail
Note that I originally called this the 'spec' formatter (in homage to RSpec and Mocha's spec formatters) but I went with summary instead in the end - spec seems a bit overloaded in our world. WDYT? |
Failing ✗ | ||
|
||
2 scenarios (1 passed, 1 failed) | ||
2 steps (1 passed, 1 failed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you choose to not print the actual error? Are you assuming this is used in conjunction with other formatters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops the push was out of date. Try now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have Formatter::ConsoleIssues
extracted, I'm hoping we can make it print the same output as you're doing for Cucumber-JS @charlierudolph. Where's the best place to get a reference for that behaviour?
Note that I also think this might be a useful tool to help finish off #992 since the output is simple. |
@@ -80,51 +78,23 @@ def print_element_messages(element_messages, status, kind) | |||
end | |||
end | |||
|
|||
def print_stats(features, options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The public methods of the Console module are part of the public API (see #893), so this PR introduces breaking changes (which is OK since we are aiming at 3.0.0 - but the PR is miss labeled).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point Bjorn. I'd like to get rid of that module altogether really, or at least slim down its interface a lot. Using composition (e.g. ConsoleIssues
) is the way forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I've updated the labelling on the PR.
I regret that I didn't tease apart the refactoring from the development of the new formatter, but it was late. I guess I still could if you think that would make it easier to review / merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have been nice for this change to be documented in the changelog 🍻
I believe this is ready to merge @cucumber/cucumber-ruby |
OK, no objections so I'm going to merge this. |
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
Introduce a new formatter that provides a summary of scenarios being run
Details, motivation, context
This is a nice simple example of how to write a formatter with the new API. It's helped me drive out or extract some cleaner replacement code for common stuff like the end-of-run stats, and should also prove more reliable than the pretty formatter when run in random mode, because of its simplicity.
I have an idea that this could be made more awesome, with more console-based fanciness to show the details of each step for the currently-running scenario, then collapse back into the scenario title / result once it moved on to the next one. Anyway that can come in another ticket.
How Has This Been Tested?
New feature in docs/formatter. A couple of unit tests for some of the extracted pieces.
Screenshots
:
Types of changes
Checklist: