You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm investigating JUnit5 for a project, and I find the concept of TestFactory and DynamicTests interesting for our use case. During the execution of a DynamicTest, I would also like to report some additional information for that particular test, so I added a TestReporter parameter to the TestFactory method:
Using a TestExecutionListener, I can see that the ReportEntrys are published, but they are all associated with the wrong TestIdentifier. Quite obvious, when thinking about it, since the TestReporter, once injected, is associated with the ExtensionContext it was assigned when it was created.
So it does not seem to be possible to use a TestReporter in conjunction with DynamicTest this way. Is it possible to achieve this some other way? Since the TestExecutionListener reports the correct TestIdentifier for lifecycle events (e.g. executionFinished) for the other DynamicTests, it seems like it should be possible somehow to dynamically assign the correct context to a TestReporter.
I'm investigating JUnit5 for a project, and I find the concept of
TestFactory
andDynamicTests
interesting for our use case. During the execution of aDynamicTest
, I would also like to report some additional information for that particular test, so I added aTestReporter
parameter to theTestFactory
method:Using a
TestExecutionListener
, I can see that theReportEntry
s are published, but they are all associated with the wrongTestIdentifier
. Quite obvious, when thinking about it, since theTestReporter
, once injected, is associated with theExtensionContext
it was assigned when it was created.So it does not seem to be possible to use a
TestReporter
in conjunction withDynamicTest
this way. Is it possible to achieve this some other way? Since theTestExecutionListener
reports the correctTestIdentifier
for lifecycle events (e.g.executionFinished
) for the otherDynamicTest
s, it seems like it should be possible somehow to dynamically assign the correct context to aTestReporter
.Related Issues
The text was updated successfully, but these errors were encountered: