-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Core] Add UnusedStepsSummaryPrinter #1648
Conversation
Could you show me an example of the output? |
The current output is:
For a sample project here: https://github.com/timtebeek/cucumber-jvm-issues-1633/tree/step-defined-event/src/test/java/com/github/timtebeek |
Looks good. I was initially thinking we should use the same format as the default summary printer, but we may as well add it to the default summary printer. That way there is no need for an additional So let's add it to the default summary printer! For example:
|
Okay. That was a terrible idea. Its nice when running the full suite but a nuisance when running a selection. Let's not add it, but let's use the same format. |
Running a selection is indeed why I had implemented this as a separate plugin so far; thanks for the suggestions; I've updated the plugin accordingly. Not really sure how to cover this with tests, and/or if we're still on track for an eventual merge.. |
We are good. I think a simple unit test where events go in and and the right output string is produced should be sufficient. |
Perfect; added |
core/src/main/java/cucumber/runtime/formatter/UnusedStepsSummaryPrinter.java
Outdated
Show resolved
Hide resolved
core/src/main/java/cucumber/runtime/formatter/UnusedStepsSummaryPrinter.java
Outdated
Show resolved
Hide resolved
core/src/main/java/cucumber/runtime/formatter/UnusedStepsSummaryPrinter.java
Outdated
Show resolved
Hide resolved
core/src/main/java/cucumber/runtime/formatter/UnusedStepsSummaryPrinter.java
Outdated
Show resolved
Hide resolved
core/src/main/java/cucumber/runtime/formatter/UnusedStepsSummaryPrinter.java
Outdated
Show resolved
Hide resolved
Thanks for directly applying your own suggestions.. as a note: I'd used package private modifier as the inner class event handlers otherwise need to use syntactic accessors to access the private fields (or so my IDE tells me), but the code should work fine as it is now, and probably clearer. Shall I merge? Or feel free to merge of that's faster.. :) great to see this added, saves me copy and pasting it where I need it. |
It's a new github feature. Really nice. I've merged it. I've been using a format that makes it look reasonably nice. But I still need to document it so other people can use it too. |
Perfect, thanks for the review/guidance/merge! :) |
You're welcome. Anytime. |
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
Adds a plugin to find and report on unused steps.
Details
As discussed in #1634 it uses the new StepDefinedEvent to locate all registered steps, and prints a summary of unused steps to the argument file.
Motivation and Context
Allows to easily find unused steps, which might be indicative of removed functionality or missed test coverage.
How Has This Been Tested?
Not yet; as @mpkorstanje indicated some hesitation on whether this would warrant adoption. This PR is to record that discussion, and will be updated depending on the outcome. Same goes for the current Java8 baseline, so it might need to target a future version rather than the next.
Screenshots (if appropriate):
Types of changes
Checklist: