cucumber-jvm icon indicating copy to clipboard operation
cucumber-jvm copied to clipboard

Deprecate and remove `SummaryPrinter`

Open mpkorstanje opened this issue 5 years ago • 3 comments

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 SummaryPrinter interface
  • [x] v7.0.0 Remove default_summary and null_summary plugins.
  • [x] v7.0.0 Add -[-no]-summary comand line option
  • [x] v7.0.0 Clean up plugin related parts of RuntimeOptions*.
  • [x] v7.0.0 Remove default_summary and null_summary plugins.
  • [ ] v8.0.0 Remove SummaryPrinter interface

mpkorstanje avatar Jul 17 '20 11:07 mpkorstanje

Hi Could I have a go at this issue?

michiboo avatar Aug 20 '20 11:08 michiboo

@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.

mpkorstanje avatar Aug 20 '20 13:08 mpkorstanje

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.

stale[bot] avatar Apr 14 '23 08:04 stale[bot]