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
Currently, the way to get the stdout/stderr of the tests from a custom TestExecutionListener is to override the reportingEntryPublished() method and watch for stdout or stderr keys in the entries.
The big downside of the current state of things is that JUnit captures the whole output of the test before sending these 2 report entries. This is very limited and doesn't allow proper streaming of the test output when this is needed.
It would be great if the listener could receive events line by line. One way to do this would be to call reportEntryPubished for each line of output. This is backwards-incompatible, and also might not align with report-oriented semantics of this method. Instead, there could be new methods for these events, like stdoutLinePrinted and stderrLinePrinted (names TBD). This would allow using TestExecutionListener to stream outputs of the tests for consumers like build tools or IDEs.
The text was updated successfully, but these errors were encountered:
I think that's an interesting use case. If we decide to do it, I think it should be enabled via separate configuration parameters and we should adapt OpenTestReportingListener to collect "streaming" output and include it in the XML report unless the existing capture feature is enabled.
A very related topic is how it would look like to report streaming output from multithreaded+parallel tests, which has to be on the test-author side: #4323
Currently, the way to get the stdout/stderr of the tests from a custom
TestExecutionListener
is to override thereportingEntryPublished()
method and watch forstdout
orstderr
keys in the entries.The big downside of the current state of things is that JUnit captures the whole output of the test before sending these 2 report entries. This is very limited and doesn't allow proper streaming of the test output when this is needed.
It would be great if the listener could receive events line by line. One way to do this would be to call
reportEntryPubished
for each line of output. This is backwards-incompatible, and also might not align with report-oriented semantics of this method. Instead, there could be new methods for these events, likestdoutLinePrinted
andstderrLinePrinted
(names TBD). This would allow usingTestExecutionListener
to stream outputs of the tests for consumers like build tools or IDEs.The text was updated successfully, but these errors were encountered: