livery.extensions.coverage._tasks¶
livery.extensions.coverage._tasks ¶
The coverage extension's verbs, loaded through the extension's entry point.
Importing this module registers the coverage group: coverage.leg,
the entry the extension adds to each check leg, and coverage.union,
the judge it adds to the gate point's verdict job, both placed by the
extension's extension.toml; and coverage.enforce and
coverage.accept, which a person runs. The base's plugin never
imports this module.
Functions:
| Name | Description |
|---|---|
coverage_leg |
Leave this leg's suites' parts for its write, measuring the unrecorded first. |
coverage_union |
Union the run's legs' parts with the records' and enforce the floors. |
coverage_enforce |
Enforce every package's floor on the measured data here. |
coverage_accept |
Lower a package's coverage mark deliberately, with the reason on the record. |
Attributes:
| Name | Type | Description |
|---|---|---|
coverage_group |
|
coverage_group
module-attribute
¶
coverage_group = group('coverage', help='The measured union and its floors')
coverage_leg ¶
Leave this leg's suites' parts for its write, measuring the unrecorded first.
The check leg's entry, after the gate and before the leg's own
write, ci.leg. When the gate ran narrowed or skipped, the
suites no record can supply at their current closure run first,
measured. Then each suite the leg ran gets its parts in the line
format, the ones its measurer left and the ones the reductions make
of the run's data, and they are left, with the scope the leg
measured, for the leg's write, which puts them on the leg's per-run
ref beside the timing row; each suite's size prints raw and
gzipped. Refuses when a leg that ran its suites left no part of
any, or a reduction refuses, and when the parts could not be left,
so a leg that measured is never judged as an empty union.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_tasks.py
coverage_union ¶
Union the run's legs' parts with the records' and enforce the floors.
The gate job's judge: every check leg's parts are read from its per-run ref, every suite no leg ran is carried from a record on that leg at the suite's current closure, the parts merge by the line format's rules into the union file, and the union judges every package. On main's run the record is then written back. Refuses when no leg left its parts, when a leg the run runs left no ref, when a leg that ran its gate left no parts, and when a suite neither the run nor the record can supply, so nothing passes as a smaller union; the verdicts print, so the numbers on screen are the numbers enforced. The percentages are left as the coverage section of the run's row, which the collect after it folds into the run's file.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_tasks.py
coverage_enforce ¶
Enforce every package's floor on the measured data here.
In the gate job, after its union, the data is the union file every leg's parts made; on a machine it is what the last measured run left. The same floors a machine's run of the tests previews, here judged on the cross-platform union.
Source code in packages/extensions/coverage/src/livery/extensions/coverage/_tasks.py
coverage_accept ¶
coverage_accept(package: Annotated[str, doc('the package path, as packages/forge')], value: Annotated[float, doc('the new mark, in percent')], reason: Annotated[str, doc('why the mark comes down; goes on the record')] = '') -> None
Lower a package's coverage mark deliberately, with the reason on the record.
The mark rises on its own when a run clears it; lowering it is a person's act, so this writes a dated row naming who and why, and the next gated run judges from it. Refuses without a reason, for a package not under auto-ratchet, at or above the current mark, or when the marks cannot be read.