Coverage for a run (design notes §10.5): which tests each mutant runs.
run/3 takes the booted pool and the build, decides what to probe from the coverage
index (Juggernaut.Coverage.Index.stale/2), probes those test files
(Juggernaut.Coverage.Probe), updates the index, and gives every mutant its selection
(Juggernaut.Coverage.Selection): the tests that hit its site, the whole file, the
whole suite (with the reason), the boot lane, or none (no_coverage).
Summary
Functions
The keys of the mutants of the boot set's sites.
The runnable (not excluded) tests of the boot inventory, by test file.
Coverage of mutants (each with its switch). Options
Each mutant's selection by its id, from the labels by key and the boot keys.
Each site (first switch) with its mutants, from the build's sites.
Types
@type result() :: %{ index: Juggernaut.Coverage.Index.t(), selections: %{required(String.t()) => Juggernaut.Coverage.Selection.t()}, probed: %{required(String.t()) => Juggernaut.Coverage.Probe.file_result()}, stale: {:all, String.t()} | {:files, %{required(String.t()) => String.t()}} }
Functions
@spec boot_keys([pos_integer()], %{required(pos_integer()) => [Juggernaut.Mutant.t()]}) :: MapSet.t(String.t())
The keys of the mutants of the boot set's sites.
@spec inventory(%{required(id()) => %{file: String.t(), excluded?: boolean()}}) :: %{ required(String.t()) => [id()] }
The runnable (not excluded) tests of the boot inventory, by test file.
@spec run([Juggernaut.Mutant.t()], keyword()) :: {:ok, result()} | {:error, Juggernaut.Error.t()}
Coverage of mutants (each with its switch). Options:
:workers(required) -[{index, pid}]of the booted pool;:info(required) - a worker's boot info: the test inventory and the boot set;:sites(required) - the build's sites, first switch → switches;:current(required) - the project's hashes (Juggernaut.Coverage.Index.current/4), to which the keys ofmutantsare added (Juggernaut.Coverage.Index.keys_by_source/1);:index- the index read from disk (nilwhen none);:durations,:seed,:timeout_ms- asJuggernaut.Coverage.Probe.run/3.
@spec selections( [Juggernaut.Mutant.t()], %{required(String.t()) => [Juggernaut.Coverage.Selection.label()]}, MapSet.t(), map() ) :: %{required(String.t()) => Juggernaut.Coverage.Selection.t()}
Each mutant's selection by its id, from the labels by key and the boot keys.
@spec site_mutants(%{required(pos_integer()) => [pos_integer()]}, [ Juggernaut.Mutant.t() ]) :: %{ required(pos_integer()) => [Juggernaut.Mutant.t()] }
Each site (first switch) with its mutants, from the build's sites.