cli.cov¶
Generate coverage reports from otto test --cov output.
Merges .gcda files collected from one or more otto test runs,
processes them with lcov, and renders a multi-tier HTML report.
Usage:
otto cov report RUN_DIR1 [RUN_DIR2 ...] --report ./my_report
Each RUN_DIR is an otto test output directory containing a cov/
subdirectory with per-host .gcda files. Multiple directories can be
specified to stitch together coverage from separate test runs.
Per-host toolchains (gcov, lcov) are resolved automatically from
host configuration in hosts.json or by inspecting .gcno files.
See the Coverage Collection and Working with hosts documentation.
Options
--report PATHWhere to place the generated HTML report (default:
./cov_report).--project-name STRTitle shown in the HTML report header.
--tier NAME[=PATH]Repeatable. Add a coverage tier to the report.
NAMEis a free-form label (e.g.unit,manual,integration);PATHis the lcov.infofile feeding that tier. The bare form--tier system(no path) refers to the implicit system tier produced by merging the supplied.gcdadirectories.The order of
--tierflags is the precedence order: the first flag is the highest-precedence tier and wins the row coloring on the annotated source view. If no--tierflags are given, defaults to--tier system.Example:
otto cov report runs/ \\ --tier unit=u.info \\ --tier system \\ --tier integration=i.info \\ --tier manual=m.info
otto cov get fetches .gcda counters straight from the lab (mirroring
otto test --cov’s collection step) and produces a pinned
capture.json per board in its output directory. It is the single
retrieval command for both automated (e2e-kind tier) and manual-session
(manual-kind tier) capture production:
otto cov get --tier manual --ticket JIRA-123
Options
--output PATH / -o PATHWhere to write fetched coverage and per-board captures (default: the standard per-invocation output directory under the xdir, same as every other lab-touching command).
--tier NAMECoverage tier to stamp onto each capture. Defaults to the lab’s sole e2e-kind tier; ambiguous or unknown names list the configured tiers.
--ticket STRTicket reference stamped onto each capture. Required when
--tierresolves to a manual-kind tier.--note STRFree-text note stamped onto each capture (manual-kind tiers only).
--tester-name STR/--tester-email STRTester identity stamped onto each capture (manual-kind tiers only). Default to
getpass.getuser()andgit config user.emailrespectively; an unset email is omitted rather than stamped empty.--cleanZero the fetched Unix hosts’ remote
.gcdacounters after a successful retrieval — for use before starting a manual session.
otto cov clean zeroes .gcda counters on the lab’s Unix coverage
hosts — the same host selection get fetches from — without first
fetching anything. Useful ahead of a manual session when the previous
capture has already been retrieved:
otto cov clean
Embedded coverage hosts are out of scope for this phase (counter reset
requires a product-side cov_reset LLEXT function mirroring
cov_dump, a later phase); when the lab has any, the command logs a
note and exits 0 rather than failing.
- otto.cli.cov.cov_callback(ctx: Context) None¶
Generate coverage reports and fetch/clean lab coverage counters.
cov reportis purely local — it reads coverage artifacts and writes an HTML report.cov getandcov cleanreach the lab’s coverage hosts (fetching or zeroing remote.gcdacounters). Onlycov getcreates a per-invocation output directory (it is where its captures land by default);reportandcleanopt out via their leaf markers.
- otto.cli.cov.report(output_dirs: ~types.Annotated[list[~pathlib.Path] | None, <typer.models.ArgumentInfo object at 0x730179a7a470>] | None = None, report_dir: ~pathlib.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x730179a7a2c0>] = PosixPath('cov_report'), project_name: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x730179a7b4c0>] = 'Coverage Report', prefix: ~types.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x730179a79630>] | None = None, tier: ~types.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x730179a7ae30>] | None = None) None¶
Generate a coverage report from otto test –cov output directories.
- otto.cli.cov.get(output_dir: ~types.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x730179a7b2e0>] | None = None, tier: ~types.Annotated[str | None, <typer.models.OptionInfo object at 0x730179a7b070>] | None = None, ticket: ~types.Annotated[str | None, <typer.models.OptionInfo object at 0x730179a7b8e0>] | None = None, note: ~types.Annotated[str | None, <typer.models.OptionInfo object at 0x730179a7ba00>] | None = None, tester_name: ~types.Annotated[str | None, <typer.models.OptionInfo object at 0x730179a7bb20>] | None = None, tester_email: ~types.Annotated[str | None, <typer.models.OptionInfo object at 0x730179a7bca0>] | None = None, clean: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x730179a79cf0>] = False) None¶
Fetch .gcda coverage from the lab and produce pinned per-board captures.