Skip to content

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

@joffrey-bion

Description

@joffrey-bion

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions