Skip to content

Deprecate and remove SummaryPrinter #2054

@mpkorstanje

Description

@mpkorstanje

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

  • v7.0.0 Deprecate SummaryPrinter interface
  • v7.0.0 Remove default_summary and null_summary plugins.
  • v7.0.0 Add -[-no]-summary comand line option
  • v7.0.0 Clean up plugin related parts of RuntimeOptions*.
  • v7.0.0 Remove default_summary and null_summary plugins.
  • v8.0.0 Remove SummaryPrinter interface

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions