livery.extensions.coverage._leg¶
livery.extensions.coverage._leg ¶
The check leg's half of coverage: each suite's parts, left for the leg's write.
A check leg's tests run measured. At the leg's end the coverage
extension's entry, coverage.leg, first runs the suites no record
can supply at their current closure, when the gate ran narrowed or
skipped (top_up). Then it gathers the parts of every suite the leg
ran (gather_leg): the parts a native suite's measurer left in the
workspace, and the parts the listed reductions make of the data the
run left, once for each suite, each holding the files of the suite's
closure. It leaves them in the line format's stored form, with the
fixed facts they name and the scope the leg measured, for the leg's
one write, which puts them on the leg's per-run ref beside its timing
row, and it prints each suite's size as a record stores it, what ran
and its fixed facts, raw and gzipped, with the share of what ran that
names the tests that reached each line.
Functions:
| Name | Description |
|---|---|
suites_of |
The packages with a test directory: the units the record keys. |
units_of |
The recorded units: every package's suite, then the workspace's own tests. |
own_tests |
The workspace's own tests, as a unit a test step runs; none otherwise. |
suites_that_ran |
The units the leg ran, by its scope marker and its shard's record. |
on_this_shard |
units less those that did not run on this shard; all on one shard of one. |
request |
What a reduction is asked for unit: its tests' contexts and its closure. |
sizes |
unit as a record stores it: its row's bytes, the tests' share, its facts'. |
shown_sizes |
unit's size as a line shows it: what ran, its fixed facts, the tests' share. |
shown_size |
count bytes as a line shows them: |
gather_leg |
Gather the parts of every suite the leg ran and leave them for its write. |
unrecorded |
Of units, those no record in bases can supply on this leg; each says why. |
with_unstored_suites |
subset plus every suite no record can supply for this leg. |
top_up |
Run the suites no record can supply on this leg; the scope the leg measured. |
Attributes:
| Name | Type | Description |
|---|---|---|
MEASURED |
|
suites_of ¶
The packages with a test directory: the units the record keys.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
units_of ¶
The recorded units: every package's suite, then the workspace's own tests.
The workspace's own tests are a unit while a test step runs them
(own_tests).
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
own_tests ¶
The workspace's own tests, as a unit a test step runs; none otherwise.
The unit (livery.workshop.workspace_suite) holds the root's set, and a test step runs it while that set holds an extension the step names (livery.workshop.tested), the rule the test step itself asks (livery.workshop.scoped_suite). A root whose set holds no such extension runs none of its own tests, so no leg leaves a part for them and no record holds them.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
suites_that_ran ¶
The units the leg ran, by its scope marker and its shard's record.
Every suite after a full gate, the named packages' suites after a
narrowed or a measured one, none after a skip; the workspace's
own tests whenever any suite ran and a test step runs them
(own_tests), since every leg that runs a suite runs them then.
On a shard of a sharded leg, those among them with a test file in
the shard's share (on_this_shard). The marker decides, never the
data's contexts: a suite whose tests reach no line that collection
had not already reached leaves no context of its own under a
first-hit tracer, and still ran.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
on_this_shard ¶
units less those that did not run on this shard; all on one shard of one.
A sharded check leg's test step runs each suite's share of its test files and records them as the items it ran, with the suites it partitioned (livery.workshop.read_shard). A suite the record names ran here where a file of it is among the items; one with no file among them ran on another shard, whose parts the gate job folds in before the union reads. A suite the record does not name, a native suite with no python test file, ran whole on the first shard with every step that does not read the shard, so the first shard expects its parts and every other shard does not. Without a record, or on one shard of one, every unit ran whole here.
Raises:
| Type | Description |
|---|---|
Failed
|
When the record does not read, naming why: a sharded leg's parts are judged by the files its shard ran. |
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
request ¶
What a reduction is asked for unit: its tests' contexts and its closure.
A package's own tests are the node ids under its tests/
directory, as the pytest extension's plugin names each test's
context; the workspace's own tests are every node id under
tests/, and their closure is every file.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
sizes ¶
unit as a record stores it: its row's bytes, the tests' share, its facts'.
Each raw, then gzipped at zlib's default level, the level git
stores an object at: the row; what the tests that reached each
line add to it, the row's size less its size without its parts'
contexts and each file's reached; and the fixed facts, one
file each as the record keeps them.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
shown_sizes ¶
unit's size as a line shows it: what ran, its fixed facts, the tests' share.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
shown_size ¶
count bytes as a line shows them: 1.3 MB, 412.0 KB.
The unit is chosen on the rounded figure, so a size that rounds to
a thousand kilobytes shows as 1.0 MB.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
gather_leg ¶
Gather the parts of every suite the leg ran and leave them for its write.
The parts are the ones a native suite's measurer left in the workspace and the ones the listed reductions make of the data the run left, asked for every other suite the leg ran; each suite's parts hold the files of its closure, and they ride the leg's per-run ref under the suite's closure identity, with the scope the leg measured, its size printed raw and gzipped. marker is the scope the leg measured, the gate's own marker when absent. A leg whose gate skipped (a tree already proved, or nothing affected) ran no suite, says so, and leaves its scope alone, so the union knows the leg skipped rather than died. A workspace with no packages (a project just born) runs its own tests unmetered, and they reach no package source; that leg leaves its units with no parts, so the union finds what the leg ran. A suite that ran and has no part is named and left out, and the union names it again; a leg whose suites ran and has no part of any is red, since nothing was measured. Only a CI run leaves the parts.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | |
unrecorded ¶
unrecorded(root: Path, run: RunContext, packages: tuple[Package, ...], units: tuple[Package, ...], *, bases: tuple[str, ...]) -> tuple[Package, ...]
Of units, those no record in bases can supply on this leg; each says why.
One read per record. A unit a record holds at its current closure identity is supplied, the branch's record asked before main's; a unit every record lacks or holds at another closure, an unreadable record, a leg without a label, or a closure git cannot identify runs the suite fresh and says why, so the union never lacks a suite and the records need no backfill.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
with_unstored_suites ¶
with_unstored_suites(root: Path, run: RunContext, packages: tuple[Package, ...], subset: tuple[Package, ...]) -> tuple[Package, ...]
subset plus every suite no record can supply for this leg.
A leg skips a suite only when its branch's record or main's holds the suite's parts at its current closure on this leg; the rest run fresh, and the line says why.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_leg.py
top_up ¶
Run the suites no record can supply on this leg; the scope the leg measured.
Inside CI alone, after the gate: a full gate ran every suite, and a
machine's run has no record to read. A narrowed gate
(affected) ran the suites its marker names, and every other
suite is asked of the branch's record and main's
(with_unstored_suites); a gate
that judged nothing (nothing) asks the same of every suite; a
gate that skipped a proved tree (verified) asks it of every
unit a listed test step runs, the workspace's own tests among
them, the record of the branch the verified row names first. The
units no record holds at their current closure run through the
test phase's steps (livery.workshop.run_phase_over), measured,
and the scope names them: a narrowed leg's packages gain them, and
a skipped leg's scope becomes measured, naming them. A leg with
nothing to run keeps its scope.