Juggernaut.Summary (Juggernaut v0.4.0)

Copy Markdown View Source

The scored outcome of a run (design notes §10.7, §14.1).

counts is keyed by status plus :mutants (all mutants), :timeout (timeout kills), :reused and :integration_only (the kills, as scored, that only an integration test made: Juggernaut.Result.integration_only?/1; they count as killed too). Scores are percentages, nil when nothing was scored. new_ignores, triage_claims and weakening (the tests weakened since a cached result's commit, Juggernaut.Cache.Weakening) are maps with string keys, as they appear in the agent JSON (§5.2). reused.recorded_ms is the sum of the recorded durations of the reused results: the only basis on which time saved is ever reported. timeouts is the timeouts setting the run was scored with (nil for a run recorded before it was kept). error is the message of the infrastructure error that ended a run with exit 3 before its verdict (nil otherwise): such a run is recorded with the phases it got through.

Summary

Functions

The keys counts may hold.

Every gate rule a failure can name.

Every verdict.

Types

failure()

@type failure() :: %{
  rule: rule(),
  file: String.t() | nil,
  mutant_id: String.t() | nil,
  score: float() | nil,
  threshold: number() | nil
}

rule()

@type rule() :: :core | :changed | :no_coverage | :incomplete

t()

@type t() :: %Juggernaut.Summary{
  advisory?: boolean(),
  counts: %{required(atom()) => non_neg_integer()},
  error: String.t() | nil,
  exit_code: 0..3,
  failures: [failure()],
  kill_kinds: %{required(atom()) => non_neg_integer()},
  new_ignores: [map()],
  reused: %{results: non_neg_integer(), recorded_ms: non_neg_integer()},
  score: %{
    run: float() | nil,
    core: float() | nil,
    files: %{required(String.t()) => float()}
  },
  timeouts: :killed | :survived | nil,
  triage_claims: [map()],
  verdict: verdict(),
  wall_ms: non_neg_integer(),
  weakening: [map()]
}

verdict()

@type verdict() :: :pass | :fail | :incomplete | :error

Functions

count_keys()

@spec count_keys() :: [atom()]

The keys counts may hold.

rules()

@spec rules() :: [rule()]

Every gate rule a failure can name.

verdicts()

@spec verdicts() :: [verdict()]

Every verdict.