Juggernaut.Engine.Reconfirm (Juggernaut v0.4.0)

Copy Markdown View Source

The reconfirmation of core survivors (design notes §10.8), in the gate and release lanes once the main jobs have run.

A mutant of a core file that survived its selected tests runs again on a fresh worker (fresh?: true: its worker is recycled first) with every test of the test files whose coverage probe hit its source file. Killed there, its result is replaced: status killed, selection :reconfirm, the reason "a selection miss" (for profile). Survived there (or no test file covers it), its first result stands. Any other result there (a harness_error: the worker failed, or the control failed on a fresh worker) replaces the survivor, so the run reports it (exit 3) instead of a survivor it could not confirm. Nothing is reconfirmed in the inner lane, when the request turns it off (check), or when dispatch stopped early.

Summary

Functions

Whether result of mutant is one reconfirmation would run again.

Every runnable test of the test files whose probe hit file (the coverage index's hit_sources), sorted.

The reconfirmation jobs of the main jobs of plan (Juggernaut.Engine's plan: its :jobs, :inventory, :coverage and :schedule_opts), given their results by mutant id: one per core survivor with covering tests, in the main jobs' order.

The reason a result killed on reconfirmation carries.

The reconfirmation results that replace a survivor's, by mutant id: every one that is not survived. A kill carries the miss reason; any other (a harness_error, a pending) keeps its own, so a reconfirmation that could not decide is never dropped in favour of the survivor it was checking.

Runs the reconfirmation jobs on workers (Juggernaut.Runner.run/3 with opts) and returns the results that replace a survivor's (replacements/1).

Whether reconfirmation runs: in the gate and release lanes, when reconfirm? is on and the main dispatch did not stop early (stopped is its reason, or nil).

Functions

candidate?(result, mutant)

@spec candidate?(Juggernaut.Result.t() | nil, Juggernaut.Mutant.t()) :: boolean()

Whether result of mutant is one reconfirmation would run again.

covering_tests(file, plan)

@spec covering_tests(String.t(), map()) :: [Juggernaut.Runner.Schedule.test_id()]

Every runnable test of the test files whose probe hit file (the coverage index's hit_sources), sorted.

jobs(plan, results)

@spec jobs(map(), %{required(String.t()) => Juggernaut.Result.t()}) :: [map()]

The reconfirmation jobs of the main jobs of plan (Juggernaut.Engine's plan: its :jobs, :inventory, :coverage and :schedule_opts), given their results by mutant id: one per core survivor with covering tests, in the main jobs' order.

miss_reason()

@spec miss_reason() :: String.t()

The reason a result killed on reconfirmation carries.

replacements(again)

@spec replacements(%{required(String.t()) => Juggernaut.Result.t()}) :: [
  Juggernaut.Result.t()
]

The reconfirmation results that replace a survivor's, by mutant id: every one that is not survived. A kill carries the miss reason; any other (a harness_error, a pending) keeps its own, so a reconfirmation that could not decide is never dropped in favour of the survivor it was checking.

run(plan, workers, results, opts)

@spec run(
  map(),
  [Juggernaut.Runner.worker()],
  %{required(String.t()) => Juggernaut.Result.t()},
  keyword()
) :: [Juggernaut.Result.t()]

Runs the reconfirmation jobs on workers (Juggernaut.Runner.run/3 with opts) and returns the results that replace a survivor's (replacements/1).

wanted?(map, stopped)

@spec wanted?(%{lane: atom(), reconfirm?: boolean()}, String.t() | nil) :: boolean()

Whether reconfirmation runs: in the gate and release lanes, when reconfirm? is on and the main dispatch did not stop early (stopped is its reason, or nil).