Juggernaut.Result (Juggernaut v0.4.0)

Copy Markdown View Source

What happened to one mutant in one run (design notes §10.7, §14.1).

Statuses: :killed, :survived and :no_coverage are scored; :ignored and :equivalent are not; :compile_error mutants never ran; :harness_error makes the run exit 3; :pending mutants were not run (budget, --max-mutants, --fail-fast). kill_kind is set only for :killed, and so is test_lane: the test lane (Juggernaut.TestLanes) of the run that killed it, :integration when only an integration test did (integration_only?/1), nil when no test did (a :boot kill) or the result was recorded before test lanes. reused_from is the run id a cached result came from; duration_ms is then the recorded duration of that run's job. boots holds the stage clocks (ms by stage, Juggernaut.Peer.Boot) of each fresh boot a boot-lane job made: the mutant's, then its own control's when it had one.

Summary

Functions

Every control outcome.

Whether a result is a kill that only an integration test made (test_lane: :integration): its unit tests all passed with the mutant on. It counts as killed.

Every kill kind.

Whether a result (or status) counts toward the score.

Every selection reason.

Every status, in documentation order.

Every test lane a kill can come from.

Types

control()

@type control() :: :passed | :recovered | :failed | :skipped

kill_kind()

@type kill_kind() :: :assertion | :exception | :timeout | :crash | :boot

selection()

@type selection() ::
  :tests | :file | :suite | :warm_first | :boot | :reconfirm | :none

status()

@type status() ::
  :killed
  | :survived
  | :no_coverage
  | :ignored
  | :equivalent
  | :compile_error
  | :harness_error
  | :pending

t()

@type t() :: %Juggernaut.Result{
  boots: [%{required(atom()) => non_neg_integer()}],
  control: control() | nil,
  duration_ms: non_neg_integer(),
  kill_kind: kill_kind() | nil,
  killed_by: Juggernaut.TestRef.t() | nil,
  mutant_id: String.t(),
  nearest_miss: %{test: String.t(), site_hits: pos_integer()} | nil,
  reason: String.t() | nil,
  reused_from: String.t() | nil,
  selection: selection(),
  status: status(),
  test_lane: test_lane() | nil,
  tests: [Juggernaut.TestRef.t()],
  worker: non_neg_integer() | :boot | nil
}

test_lane()

@type test_lane() :: :unit | :integration

Functions

controls()

@spec controls() :: [control()]

Every control outcome.

integration_only?(result)

@spec integration_only?(t()) :: boolean()

Whether a result is a kill that only an integration test made (test_lane: :integration): its unit tests all passed with the mutant on. It counts as killed.

kill_kinds()

@spec kill_kinds() :: [kill_kind()]

Every kill kind.

scored?(status)

@spec scored?(t() | status()) :: boolean()

Whether a result (or status) counts toward the score.

selections()

@spec selections() :: [selection()]

Every selection reason.

statuses()

@spec statuses() :: [status()]

Every status, in documentation order.

test_lanes()

@spec test_lanes() :: [test_lane()]

Every test lane a kill can come from.