Skip to content

test(coverage): burn-down phase 2 — zero rustledger exemptions - #238

Merged
robcohen merged 1 commit into
mainfrom
test/burn-down-2
Jul 3, 2026
Merged

robcohen merged 1 commit into
mainfrom
test/burn-down-2

Conversation

@robcohen

@robcohen robcohen commented Jul 3, 2026

Copy link
Copy Markdown
Member

Stacked on #237 (the v0.20.1 upgrade — merge that first; this contains its commits until then).

Completes the coverage burn-down: every remaining rustledger/* exemption is deleted from pyproject.toml. 30 new unit tests:

File Before After
backend.py 70% 100% — actionable broken-install error
options.py 60% 100% — display formatting, quantize, RLBooking semantics (documents that it's unhashable, unlike beancount's enum)
loader.py 84% 100% — the whole Python-plugin runner (import failure, __plugins__/module-name dispatch, config, foreign-error adaptation, raising plugins), both error wire formats, FFI-precision branches in both load paths via a stubbed engine; deletes one provably-dead guard
types.py 80% 100% — FrozenDict, all three cost-number wire generations, typed custom values, meta normalization, serializer edges via duck-typed beancount-style stubs; the unreachable elif-chain exit eliminated structurally (last elif → else, membership enforced at type resolution)
engine.py, __init__.py 100% exemptions simply dropped

Also from this work session: item 3 of the improvement list (mutation-endpoint smoke) verified already satisfied by existing test_json_api coverage, and item 4 (abs(NULL)) fixed upstream as rustledger#1711.

Validation

659 passed, 100.00% with no rustledger/ exemptions for the first time; pinned ruff + mypy clean.

🤖 Generated with Claude Code

…rs the gate

Deletes every remaining rustledger/* coverage exemption. 30 new unit tests:

- backend.py (70% -> 100%): the broken-install ImportError path raises an
  actionable RustledgerError.
- options.py (60% -> 100%): display formatting (precision, commas,
  quantize) and RLBooking equality semantics — documenting that RLBooking
  is unhashable (unlike beancount's Booking enum).
- loader.py (84% -> 100%): the entire Python-plugin runner (import failure,
  __plugins__ vs module-name dispatch, config passing, foreign-error
  adaptation, raising plugins), display-precision edges, both error wire
  formats, and the FFI-provided display_precision branches in load_string
  AND load_uncached via a stubbed engine. Also deletes a provably-dead
  `if counts:` guard.
- types.py (80% -> 100%): FrozenDict semantics, all three cost-number wire
  generations (v0.20 list / v0.19 fields / flat scalar), typed custom
  values, meta normalization, amount/cost serializers, and
  directive_to_json edges via duck-typed beancount-style stubs. The
  unreachable exit edge of the directive elif-chain is eliminated
  structurally (last elif -> else; membership enforced at type resolution).
- engine.py and __init__.py were already fully covered — exemptions simply
  dropped.

659 passed, 100.00% with no rustledger exemptions for the first time.
@robcohen
robcohen enabled auto-merge (squash) July 3, 2026 21:04
@robcohen
robcohen force-pushed the test/burn-down-2 branch from 5dc923f to 4286fde Compare July 3, 2026 21:04
@robcohen
robcohen merged commit 12e116b into main Jul 3, 2026
28 checks passed
@robcohen
robcohen deleted the test/burn-down-2 branch July 3, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant