cucumber-jvm
cucumber-jvm copied to clipboard
Deprecate and remove `SummaryPrinter`
Prior to using events the SummaryPrinter interface provided a hook that could be used to print a summary. Now it only serves as a marker interface to indicate the plugin has something to print after a test run is done. This marker interface is used to determine if the default summary plugin should be replaced with a custom summary plugin. Now that only the CLI adds a default summary and progress reporter plugins the benefits of this system are marginal.
For example:
java io.cucumber.core.cli.Main --plugin com.example.CustomSummary --plugin com.example.CustomFormatter
Will ensure that neither the default summary printer nor the default default progress formatter are used by:
RuntimeOptions runtimeOptions = commandlineOptionsParser
.parse(argv)
.addDefaultGlueIfAbsent()
.addDefaultFeaturePathIfAbsent()
.addDefaultFormatterIfAbsent()
.addDefaultSummaryPrinterIfAbsent()
.build(systemOptions);
Solution
The internal logic of Cucumber could be simplified by never enabling the default progress plugin and always enabling the default summary plugin. The summary plugin would then have to be explicitly turned off via --no-summary.
This means that this should always prints a summary:
java io.cucumber.core.cli.Main
This should always prints a summary and a custom summary:
java io.cucumber.core.cli.Main --plugin com.example.CustomSummary
This should only print a custom summary:
java io.cucumber.core.cli.Main --no-summary --plugin com.example.CustomSummary
This should print a summary and progress dots:
java io.cucumber.core.cli.Main --plugin progress
This should print only progress dots
java io.cucumber.core.cli.Main --no-summary --plugin progress
This should print nothing
java io.cucumber.core.cli.Main --no-summary
And this should also print nothing:
java io.cucumber.core.cli.Main --no-summary --plugin json:out.json
Todo
- [x] v7.0.0 Deprecate
SummaryPrinterinterface - [x] v7.0.0 Remove
default_summaryandnull_summaryplugins. - [x] v7.0.0 Add
-[-no]-summarycomand line option - [x] v7.0.0 Clean up plugin related parts of
RuntimeOptions*. - [x] v7.0.0 Remove
default_summaryandnull_summaryplugins. - [ ] v8.0.0 Remove
SummaryPrinterinterface
Hi Could I have a go at this issue?
@michiboo not really. This isn't scheduled until v7.0.0 and we currently don't have a reason to make the next major version. Until that time this feature can hang around.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two months if no further activity occurs.