Skip to content

test: cover the bundled wasm-path fallback under any ambient env - #248

Merged
robcohen merged 1 commit into
mainfrom
fix/cover-wasm-path-fallback
Jul 10, 2026
Merged

robcohen merged 1 commit into
mainfrom
fix/cover-wasm-path-fallback

Conversation

@robcohen

Copy link
Copy Markdown
Member

What

Adds the symmetric monkeypatch.delenv test for _default_wasm_path()'s bundled-path fallback, so both branches are covered regardless of the ambient RUSTLEDGER_COMPONENT_WASM.

Why

rustledger's downstream CI (downstream.yml, rustfava tests against PR component) exports RUSTLEDGER_COMPONENT_WASM for the whole pytest run. With the variable set, the fallback line (component_engine.py:122) never executes, coverage lands at 99.97%, and the --cov-fail-under=100 gate fails — on an environment quirk, not a real gap. That job has been red on this for its entire recent history (0 successes in the last 60 runs), which meant a systemically-red check on every rustledger PR.

The override branch already had a monkeypatch.setenv test; the fallback branch was only covered incidentally, by runs where the ambient variable happened to be unset (rustfava's own CI — which is why it stayed green here while downstream burned).

Testing

  • Full just test-py at 100.00% with the env var exported (the exact downstream shape), against a locally built rustledger component — 660 passed.
  • File-level ruff check/format and mypy clean.

🤖 Generated with Claude Code

rustledger's downstream CI exports RUSTLEDGER_COMPONENT_WASM for the
whole pytest run, so _default_wasm_path()'s bundled-path fallback
never executed there and the 100% coverage gate failed on an env
quirk (99.97%, component_engine.py:122) — every downstream run has
been red on it. The override branch already had a monkeypatch.setenv
test; this adds the symmetric monkeypatch.delenv test so BOTH
branches are covered regardless of the ambient variable.

Verified: full test-py at 100.00% WITH the env var exported (the
downstream shape, against a locally built component) and file-level
ruff/mypy clean.

Co-Authored-By: Claude Fable 5 <[email protected]>
@robcohen
robcohen merged commit dccb1b1 into main Jul 10, 2026
31 checks passed
@robcohen
robcohen deleted the fix/cover-wasm-path-fallback branch July 10, 2026 13:27
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