Juggernaut.View.Stream (Juggernaut v0.4.0)

Copy Markdown View Source

The NDJSON event stream (--stream, see the agent output guide), format 1: one compact JSON object per line, each with v, event, run_id and t_ms (milliseconds since the run started) first.

The runner describes what happens as event/0 values; lines/4 turns one into its lines. The same events drive the live terminal view (Juggernaut.View.Live), so both show the same run. A mutant event whose result is listed as a survivor is followed by a survivor line carrying the full agent survivor object; run_finished is followed by a report line holding the agent document when the report option is set (--stream --format agent).

A mutant line's test_lane is the test lane of a kill (unit, or integration when only an integration test killed it), null otherwise; run_finished counts those in counts.integration_only.

Summary

Types

Something that happened in a run, as the views see it.

Functions

The NDJSON lines (each ending in a newline) of one event.

The JSON objects of one event, in line order.

Types

event()

@type event() ::
  {:run_started, Juggernaut.Run.t()}
  | {:phase_started, Juggernaut.Phase.name()}
  | {:phase_finished, Juggernaut.Phase.t()}
  | {:plan,
     %{
       mutants: non_neg_integer(),
       by_file: %{required(String.t()) => non_neg_integer()},
       ignored: non_neg_integer()
     }}
  | {:reuse, %{reused: non_neg_integer(), recorded_ms: non_neg_integer()}}
  | {:worker,
     %{
       worker: non_neg_integer() | :boot,
       state: :up | :recycled | :down,
       reason: String.t() | nil,
       duration_ms: non_neg_integer() | nil
     }}
  | {:mutant, Juggernaut.Mutant.t(), Juggernaut.Result.t()}
  | {:boot_lane,
     %{
       mutants: non_neg_integer(),
       concurrency: pos_integer(),
       reason: String.t()
     }}
  | {:warning,
     %{
       code: atom(),
       message: String.t(),
       file: String.t() | nil,
       line: pos_integer() | nil
     }}
  | {:run_finished, Juggernaut.Run.t()}

Something that happened in a run, as the views see it.

Functions

lines(event, run_id, t_ms, opts)

The NDJSON lines (each ending in a newline) of one event.

objects(event, run_id, t_ms, opts)

The JSON objects of one event, in line order.