Juggernaut.Runner.Classify (Juggernaut v0.4.0)

Copy Markdown View Source

What one job's result says about its mutant (design notes §10.7): a status and, for a kill, its kind and the killing test.

The table below is golden-tested (test/golden/status_table.md); each row is one input shape, first match wins.

Job resultStatusKill kind
ran, every test passedsurvived
ran, first failure ExUnit.AssertionErrorkilledassertion
ran, first failure ExUnit.TimeoutErrorkilledtimeout
ran, first failure a linked process's exit ({:EXIT, pid})killedcrash
ran, first failure another exception, a throw or an exitkilledexception
ran, setup_all failed (the test is invalid)killedexception
past the job deadline (worker recycled)killedtimeout
worker died with the mutant on (System.halt/1, VM abort)killedcrash
harness error (raised outside the tests, count mismatch)harness_error
boot lane: app did not start, or test files did not loadkilledboot
boot lane: worker died while starting with the mutant onkilledcrash
boot lane: worker hung while starting with the mutant onkilledtimeout
boot lane: the suite ranas a job result
boot lane: failed before the mutant was onharness_error

A job result is the map Juggernaut.Pool.Worker.run/3 answers; a boot-lane outcome is Juggernaut.Runner.BootLane.run/2's. The killing test is the first test reported failed. A worker that dies running a job with every mutant off (a control) is not classified here: the runner (Juggernaut.Runner) treats it as a failed control.

Summary

Functions

The status of a mutant from its boot-lane outcome (see the module doc).

The status of a mutant from its job's result (see the module doc).

The kill kind of a failed test's outcome (Juggernaut.Peer.Formatter.outcome/1).

Types

t()

@type t() :: %{
  status: Juggernaut.Result.status(),
  kill_kind: Juggernaut.Result.kill_kind() | nil,
  killed_by: test_id() | nil,
  reason: String.t() | nil
}

test_id()

@type test_id() :: {module(), atom()}

Functions

boot(arg)

@spec boot(
  {:killed, Juggernaut.Result.kill_kind(), String.t()}
  | {:ran, map()}
  | {:error, Juggernaut.Error.t()}
) :: t()

The status of a mutant from its boot-lane outcome (see the module doc).

job(result)

@spec job(map()) :: t()

The status of a mutant from its job's result (see the module doc).

kind(arg1)

@spec kind(map()) :: Juggernaut.Result.kill_kind()

The kill kind of a failed test's outcome (Juggernaut.Peer.Formatter.outcome/1).