csf-dev/CSF.Screenplay

Create a reporter which immediately writes to a JSON stream

Closed this issue · 2 comments

We now have a report writer which wires a report model to JSON stream, but this takes a single monolithic report and writes it all at once.

What I'd like to investigate is a reporter which writes the actual JSON incrementally as each scenario completes. This way there is no big hit of doing all of the serialisation at the end of a test run, because the work is spread out per scenario.

This might need an alternative model (one in which the scenarios and features are not hierarchical).

This needs to be thread-safe, so it will need a central 'writer' module which actually performs the writing to the JSON stream. That will need to lock against the writing process such that it can block multiple writes at the same time.

It can use tasks and async programming to avoid holding things up though.

Done