Skip to content

Effective gate treats missing coverage totals as 0% and can pass without measurements #15

Open

Description

@AlexanderLanin

Found while reviewing the architecture documentation. Verified against upstream HEAD d99515b87bbe1dde89984403e9c330d640fc5d33 using synthetic report archives and the real generate_coverage_html CLI (no gate/justification mocks).

The effective coverage path converts missing/unparseable/zero HTML totals to a numeric 0% report. The gate treats this as an evaluated percentage. At the default threshold it exits 1; at threshold 0 it exits 0, although there are no usable measurements. The raw LCOV path rejects zero instrumented lines with exit 2.

Reproduction

Create a report zip containing html_report/index.html with no parseable LLVM Totals row, an empty html_report/style.css, and lcov_report/lcov.dat with LF:0 and LH:0. Supply a valid empty YAML:

version: 1
justifications: []

Run the real generate_coverage_html CLI with --yaml:

  • COVERAGE_THRESHOLD=100: warning about unparseable totals, effective 0%, exit 1.
  • COVERAGE_THRESHOLD=0: same warning, effective 0%, exit 0.

Without YAML the zero-line LCOV yields exit 2.

Expected

Unavailable measurements must produce exit 2 for every threshold, including 0. Validate usable totals before constructing/accepting an effective gate value. Cover missing/malformed HTML totals and zero instrumented lines in both HTML backends.

This violates tool_req__coverage_gate_exit_codes and tool_req__coverage_gate_no_verdict.

Relevant code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions