junit-team / junit5

✅ The 5th major version of the programmer-friendly testing framework for Java and the JVM
https://junit.org
Eclipse Public License 2.0
6.41k stars 1.49k forks source link

Provide mechanism to reuse JUnit Jupiter extensions in other test engines #1722

Open mp911de opened 5 years ago

mp911de commented 5 years ago

While writing an own TestEngine we found it quite handy to reuse JUnit Jupiter's extension mechanism along with ExecutionCondition to conditionally run/skip classes and methods (see mp911de/microbenchmark-runner#19 for further details).

However, some implementations (such as DisabledCondition) are not visible or internal API (e.g. ExtensionRegistry). As an implementer, there are two ways to implement extension support:

Neither is great, so it would be better to be able to reuse the existing bits of JUnit Jupiter's engine implementation.

Deliverables

sbrannen commented 5 years ago

Currently slated for 5.4 M2 solely for the purpose of team discussion and triaging.

marcphilipp commented 5 years ago

FWIW @leonard84 and I came across the same issue when experimenting with what it would entail to add support for Jupiter extensions to Spock 2.0.

sormuras commented 5 years ago

Discussion in progress...

jlink commented 5 years ago

I'm not sure how useful such a feature can be.

As far as I remember most Jupiter extensions are tightly coupled to Jupiter's lifecycle. Some lifecycle stuff will be more or less present in all/most other test engines but other stuff won't. That means that some extensions will work, others won't work and some will partially work. As a user you can never rely on anything.

What could probably be made to work is a restricted set of extensions/hooks/whatever that only concern those lifecycle aspects which are shared by all test engines. I guess that's everything going through EngineExecutionListener. Obviously that's only a small subset of all extension points available in Jupiter.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. Thank you for your contribution.

leonard84 commented 3 years ago

This would help with https://github.com/spockframework/spock/issues/1273

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. Thank you for your contribution.

leonard84 commented 2 years ago

It would still be helpful to have access to the Store classes via the platform.