Expand description
bynk test --format ndjson (#2267, Slice D stage 1): the supported result
stream.
The runner already writes one JSON event per line (BYNK_TEST_FORMAT=ndjson),
an internal protocol between the generated entry and the driver. --format json collects all of it and prints one document at the end; --format ndjson
forwards it as it arrives, so a consumer sees each suite when that suite
finishes. The events the driver prints are its own, not the runner’s lines
passed through, so the contract does not depend on the runner’s wording:
run-begin {suites}suite-begin {name, kind, tests}case {suite, <the document's case fields>}: the same object the JSON document holds for the case, in the same field order, behindtypeandsuite, so it carriestierand the generative fields toosuite-end {name}run-end {passed, failed, skipped?, transport?}error {kind, message?, diagnostics?, stderr?}: the document’serrorobject, for a compile failure, a run the driver could not start or finish, and a runner that died beforerun-end
The stream ends with exactly one of run-end or error. A case a remote run
skipped (--skip-unsupported) is a case event with outcome skipped
between the last suite-end and run-end. A line that is not a recognised
runner event is dropped. Field order is the contract; a consumer ignores
event types and fields it does not know.
Structs§
- Stream
- Turns the runner’s event lines into the stream’s, one at a time.
- Stream
Context - What the stream knows about the run besides the runner’s own events.
Functions§
- events_
for - The stream for a document held in full: a run that could not start (a
compile failure, a launch error) is one
errorevent, and a normal one is its suites’ events thenrun-end. Used where nothing is read live. - forward
- Run
cmd, forwarding each event tooutas the runner writes it, and return its exit status. The runner’s stderr is collected on a thread, so a full pipe cannot stall it. Ifoutstops accepting output (a consumer that went away), the runner is killed rather than left running. - print_
run - Print a document in
--format json, or its events in--format ndjson.
Type Aliases§
- Skipped
- A remote run’s skipped case, as it goes into the stream: suite, case, reason.