Skip to content
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] The SummaryPrinter should only depend on api classes #1361

Merged
merged 4 commits into from
May 18, 2018

Conversation

brasmusson
Copy link
Contributor

Summary

The SummaryPrinter interface should only depend on api classes

Details

A plugin interface like the SummaryPrinter, which users can implement, should only depend on classes in cucumber.api packages.

Motivation and Context

API classes should not leak internal interfaces.

How Has This Been Tested?

Tested by the automated test suite.

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the javadoc documentation accordingly.

@coveralls
Copy link

coveralls commented May 13, 2018

Coverage Status

Coverage decreased (-0.008%) to 80.296% when pulling 7be8c2d on summary-printer-interface into 4d09d8c on master.

A plugin interface like the SummaryPrinter should only depend on
classes in cucumber.api packages.
@brasmusson brasmusson force-pushed the summary-printer-interface branch from c7c1fb0 to 05774ef Compare May 13, 2018 19:19
@mpkorstanje
Copy link
Contributor

I am thinking we should remove the SummaryPrintingInterface from the public API all together. Given the current interface there are two reasonable implementations and we're providing them both.

Custom implementations can listen to the the event stream like the other plugins.

@mpkorstanje
Copy link
Contributor

mpkorstanje commented May 14, 2018

Maybe we can combine the whole thing with Stats? And trigger the printing when the TestRunFinished event comes by.

@mpkorstanje mpkorstanje force-pushed the summary-printer-interface branch from 2cacbb2 to 118e732 Compare May 16, 2018 22:02
@mpkorstanje mpkorstanje force-pushed the summary-printer-interface branch from 118e732 to 91d3f03 Compare May 16, 2018 22:11
@mpkorstanje
Copy link
Contributor

Okay. Removing the summary printer from the public API was a bit too much. But I've managed to pull stats and UndefinedStepsTracker out of the runtime. It gets a bit messy around Android and PaxExam but that is okay I think.

@mpkorstanje mpkorstanje modified the milestones: 4.0.0, 3.0.0 May 18, 2018
@mpkorstanje mpkorstanje merged commit afc2581 into master May 18, 2018
mpkorstanje added a commit that referenced this pull request May 18, 2018
@brasmusson
Copy link
Contributor Author

I can think of another reasonable implementation for the SummaryPrinter interface, that is to only print the snippets. When a runner class is used the NullFormatter is the default formatter for the console. One could argue that when using a runner class maven/gradle/testng should take care of the test summary and test errors, so the only thing Cucumber-JVM should provide is the snippets.

That leads to the question which helpers Cucumber-JVM should provide to simplify the development of different types of plugins, like classes as Stats, UndefinedStepsTracker, TestSourceModel etc.

@mpkorstanje
Copy link
Contributor

I've been having similar thoughts.

The summary plug is really suited to the commandline runner. All the other runners have their own reporting mechanism. However the ports and adapters pattern we're using makes the commandline runner (through runtime options) the nucleus for all adapters. It should be the Runtime that is the nucleus.

It's why I had to add noSummaryPrinter to get rid of the default.

@mpkorstanje mpkorstanje deleted the summary-printer-interface branch September 9, 2018 17:10
@lock
Copy link

lock bot commented Sep 9, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants