ClientUtils.TestFormatter.EventStream (client_utils v0.3.2)

View Source

A run's durable record of its events, for the harness that started it to re-attach to after a restart: one JSON object per line, appended to the file named by CMS_RUN_EVENT_STREAM.

Every line has event and seq, which strictly increases within the file, and, in a shard of a run (CMS_RUN_SHARD, CMS_RUN_SHARDS), shard and shards. suite_finished carries this process's totals.

Summary

Functions

Open the stream the environment names, or nil when it names none.

Append one event, written through to the file before returning. A run without a stream, or an event the stream does not record, writes nothing.

Types

t()

@type t() :: %ClientUtils.TestFormatter.EventStream{
  file: term(),
  path: term(),
  seq: term(),
  shard: term(),
  totals: term()
}

Functions

open()

@spec open() :: t() | nil

Open the stream the environment names, or nil when it names none.

The variable is removed once read: a test that shells out to mix test would otherwise append its own run to this one's stream.

open(blank)

@spec open(String.t() | nil) :: t() | nil

write(stream, event)

@spec write(t() | nil, map() | nil) :: t() | nil

Append one event, written through to the file before returning. A run without a stream, or an event the stream does not record, writes nothing.