Coverage
Produce the report
Run:
bazelisk coverage --noshow_progress --ui_event_filters=-info --combined_report=lcov --cache_test_results=no //...Run:
bazelisk run --noshow_progress --ui_event_filters=-info //tools:analyze_coverageThe analyzer has
--helpif needed.Create
htmlcov/coverage_report.htmlfrom the analyzer output. Include every reported branch and preserve its classification, branch source, uncovered outcome when present, and uncovered destination. Thehtmlcov/directory is ignored by Git.Put actionable branches in the main review section. Give every actionable branch:
- A checkbox.
- An optional comments field.
- Its absolute source-file path in a read-only text field.
- A Copy button that copies the absolute path.
- A compact syntax-highlighted source snippet with line numbers and enough surrounding code to understand the branch. Visually distinguish the branch source line and, when it is in the same file, the uncovered destination line.
Put low-value final-case non-match branches in a separate collapsed section. Show their paths, analyzer details, and source snippets, but do not give them checkboxes or comments fields and do not include them in the submission. Explicit-exit-only branches omitted by the analyzer do not appear in the report.
Keep the report self-contained. Embed the syntax-highlighting styles and any required code in the HTML instead of loading a library from the network. HTML-escape every path, analyzer value, source line, and comment inserted into markup. Serialize data passed to JavaScript rather than interpolating source text into script code.
Make Submit send a JSON object containing the selected branches and their comments to the relative URL
submit, so the browser retains the random access path printed by the server. The server saves it ashtmlcov/coverage_report_selection.json.Run the report server:
bazelisk run --noshow_progress --ui_event_filters=-info //tools:serve_reportOpen the URL printed by the server in the user's browser. The operating system chooses the port, and the server exits automatically after saving a successful submission.
Tell the user to submit the form and then say it was submitted.
Investigate submitted items
- Read
htmlcov/coverage_report_selection.jsonafter the user reports submission. - Investigate exactly the selected branches, respecting any comments.
- For each reachable behavior, try to cover it through public, real behavior:
- Prefer an existing testdata-driven suite or another test that compiles, validates, or executes real Define source.
- For compiler and validator behavior, do not add direct tests of private implementation details merely to execute a branch.
- If the path is unreachable or exhaustive fallthrough, explain why and do not manufacture an artificial test.
- Run focused validation while iterating.
- Run the coverage command and analyzer command again for final verification. Confirm whether every selected branch disappeared or was classified as unreachable.