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

Extract EmbeddedSpecRunner-related stuff to separate (publishable) module #1178

Open
szpak opened this issue Jun 8, 2020 · 4 comments
Open

Comments

@szpak
Copy link
Member

szpak commented Jun 8, 2020

Issue description

Occasionally. it is confusing to have junit-platform-testkit provided as an optional spock-core dependency (with its own dependencies). Namely here and here.

Proposed solution

As regular tests with Spock don't need EmbeddedSpecRunner nor junit-platform-testkit it would be good to extract the related stuff (probably also with EmbeddedSpecification) to a separate publishable module (spock-testkit?) to make it used as a dependency for the Spock plugin writers or the people writing more sophisticated tests (which need to reproduce a complete (embedded) Spock life-cycle in Spock tests).

@leonard84
Copy link
Member

I am hesitant to create a new module just to have a few classes in there. Would it suffice to update the Javadoc. It already states that its mostly for spock internally.

 * Utility class that allows to run (fragments of) specs programmatically.
 * Mainly intended for spec'ing Spock itself.

We could add a notice that its usage requires the junit-platform-testkit dependency. We already have several optional dependencies, e.g. byte-buddy, so the concept is not new.

@Vampire
Copy link
Member

Vampire commented Jun 9, 2020

The concept is not new, but for the other dependencies there is a clear and obvious error message. If the testkit is missing it is more a subtle crypted error message.

@szpak
Copy link
Member Author

szpak commented Jun 9, 2020

In addition, byte-buddy or objenesis are used in regular testing (just with spying). However, EmbeddedSpecRunner is much more sophisticated tool for plugin writers or some dirty hacks. Having ~60 hits globally on GitHub for EmbeddedSpecRunner (let's skip related classes which also could be used) shows the scale. I can add a dependency manually (if needed) and I know what to expect (instead of a weird exception related to AssertJ).

@leonard84 leonard84 removed this from the 2.0 milestone Nov 4, 2021
@leonard84
Copy link
Member

We could probably do something with Gradle's feature variants here, without introducing a new module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants