Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify TestExecutionListener of test stdout/stderr output continuously instead of all at the end #4317

Open
joffrey-bion opened this issue Feb 12, 2025 · 2 comments

Comments

@joffrey-bion
Copy link

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.

@marcphilipp
Copy link
Member

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.

@joffrey-bion
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants