Skip to content

Print statements in swift-testing tests appear desynched from test result information #1054

@plemarquand

Description

@plemarquand

Describe the bug
Currently the extension merges two streams of information to produce swift-testing test output: the JSON event stream written to a named pipe and the stream of data from stdout. This captures both testing events and user outputs produced by things like print() statements.

However, this approach interleaves the two sources in an arbitrary order. Print statements produced during a test run are typically read after events on the named pipe, which makes it difficult to tell what prints belong to what test. There is no ordering guarantee as there is latency in reading from the named pipe, and from stdout/err.

The ideal solution would be to have user prints emitted in the JSON event stream as their own event type, ensuring they appear between testCaseStart/End events. Barring that perhaps something is possible where both the events and stdout are piped to the same fd.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions