Skip to content

Improve test coverage for under-tested compiler modules #324

@aallan

Description

@aallan

Problem

Project-wide test coverage is 90.91%, but several modules are significantly below that average. The Codecov project threshold is already catching small drops on PRs, and these low-coverage files are the primary drag.

Files below 85% coverage

File Lines Covered Missed Coverage
vera/browser/emit.py 23 0 23 0.00%
vera/wasm/markdown.py 289 134 155 46.37%
vera/parser.py 45 29 16 64.44%
vera/cli.py 503 344 159 68.39%
vera/wasm/inference.py 546 408 138 74.73%
vera/wasm/operators.py 303 236 67 77.89%
vera/checker/resolution.py 98 79 19 80.61%
vera/checker/control.py 238 200 38 84.03%

Files in the 85-88% range (lower priority)

File Lines Covered Missed Coverage
vera/tester.py 335 285 50 85.07%
vera/markdown.py 413 353 60 85.47%
vera/smt.py 550 472 78 85.82%
vera/codegen/closures.py 163 140 23 85.89%
vera/verifier.py 455 399 56 87.69%

Notes

  • vera/browser/emit.py (0%) is the browser bundle emitter — it writes files to disk and is only exercised by vera compile --target browser, which the test suite doesn't call directly. Likely needs a targeted integration test or pragma: no cover if it's inherently side-effectful.
  • vera/wasm/markdown.py (46%) is the WASM host binding for Markdown operations — many branches handle edge cases in the Markdown AST that existing conformance tests don't exercise.
  • vera/cli.py (68%) has many subcommands and error paths that aren't tested. The CLI tests exist but don't cover all flags and error conditions.
  • vera/wasm/inference.py (75%) and vera/wasm/operators.py (78%) have many type-specific branches in the WASM codegen that aren't hit by current test programs.
  • vera/checker/resolution.py and vera/checker/control.py likely have uncovered error-reporting branches.

Approach

For each file, assess whether the uncovered code is:

  1. Testable — write targeted unit tests
  2. Defensive/unreachable — add pragma: no cover with rationale
  3. Dead code — remove it

Goal: bring all files above 85%, overall project coverage above 91%.

Codecov dashboard

https://app.codecov.io/gh/aallan/vera?displayType=list

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciCI/CD and GitHub ActionsenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions