Repository: junit-team/junit5

Issue #2296: Let TestReporter publish entries with values not being strings
Created: 2020-05-13T13:15:31Z
Background:
I tried to implement an extension to make it possible measuring the duration of test executions. So I created an extension like the one in the JUnit5 User Guide. Everything seemed fine when I checked the example implementation provided there ("TimingExtension"). But there, the duration is just logged. However, I need to include the results in a report created by implementing a custom TestExecutionListener. Looking at the ExtensionContext interface, I thought I could use the instance provided as an argument to the beforeTestExecution/afterTestExecution methods (defined in BeforeTestExecutionCallback and AfterTestExecutionCallback, respectively) to publish entries containing the time a test is started/is finished. But, at a second glance I saw that the report entries has to be consumed by a EngineExecutionListener, which is, in my case, sadly no supertype of TestExecutionListener. So, there seems no easy way to publish those points in time to my own listener. Sadly, I found no documentation for the EngineExecutionListener in the user guide, so I don't expect the reports are internally received and passed further, such that they are also avaible in execution listeneres. So two questions arise:

A compound value type holding the start time of test execution and the end time of test execution published through my extension for further use in the listener would be a good fit. Sadly, only publishing the string representation of these times seem to be possible. Therefore, the duration of actual test execution, if not published additionally also as a string representation (which would be kinda redundant in my opinion), has to be computed in the listener after first parsing the time points' string representations. Why isn't it simply possible to publish non-string keys?
How can I publish results from an extension to an execution listener?

Thanks to you in advance for any response.

Duplicate issue #2411: Introduce communication link between test engine and platform extensions
Created: 2020-09-18T12:56:12Z
We have a TestExecutionListener implementation that collects base information about tests, and for some of the engines, we have additional extensions that enrich that information with engine-specific data, for example for Jupiter we catch fixtures execution using InvocationInterceptor.
Our TestExecutionListener holds the state and we need to send data from InvocationInterceptor to our TestExecutionListener. The only option available so far is to publish report entries using ExtensionContext#publishReportEntry method and process these entries in TestExecutionListener#reportingEntryPublished method. And all that smell bad
The current issues:

In some cases report entries are published to system out
Users may use report entries on it's general-purpose -- to enrich tests with some data.

So users got spammed by our internal communication.
Jupiter API exposes ExtensionContext.Store that can be used to share data between Jupiter extensions. The solution I have in mind is to add a similar API to the platform level and expose this API for the engines. In that way the engines can support such API in their extensions to build a communication link between platform and engine extensions

Closing comment (2020-10-23T10:38:44Z): Duplicate of #2296