junit5 icon indicating copy to clipboard operation
junit5 copied to clipboard

Provide mechanism to reuse JUnit Jupiter extensions in other test engines

Open mp911de opened this issue 6 years ago • 8 comments

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:

  • Using internal API
  • Reimplementing

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

Deliverables

  • [ ] Stable implementation of ExtensionRegistry
  • [ ] Stable implementation of support classes (such as AbstractExtensionContext and ExtensionUtils)

mp911de avatar Jan 08 '19 13:01 mp911de

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

sbrannen avatar Jan 08 '19 13:01 sbrannen

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.

marcphilipp avatar Jan 08 '19 16:01 marcphilipp

Discussion in progress...

sormuras avatar Jan 11 '19 11:01 sormuras

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.

jlink avatar Jun 13 '19 18:06 jlink

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.

stale[bot] avatar May 13 '21 19:05 stale[bot]

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

leonard84 avatar May 14 '21 20:05 leonard84

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.

stale[bot] avatar Jun 19 '22 20:06 stale[bot]

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

leonard84 avatar Jun 22 '22 17:06 leonard84