Repository navigation
chore: run the python-gated cargo tests with bean-check installed - #1746
Conversation
Several cargo test suites compare rledger against Python beancount
directly (Command::new("bean-check")) and skip silently when the
binary is absent — which is every CI environment today. The
use-before-open silent-pass bug (#1742) sat on main behind exactly
that skip: test_account_lifecycle_consistency would have caught it,
but nothing ever ran it with bean-check on PATH.
Add a python-gated-cargo-tests job to the Compatibility workflow
(which already runs on push/PR/nightly and owns the python setup):
- pip install beancount, then ASSERT bean-check is runnable before
testing — if the binary breaks, the job goes red at the assert
instead of the tests green-skipping;
- run the two python-gated suites (rustledger integration_test,
rustledger-core synthetic_generation), with a comment pointing at
the grep that enumerates them;
- a final belt-and-braces step greps a rerun for the skip marker, so
a future availability-probe drift (different binary, container)
cannot reintroduce the silent skip.
Verified locally with bean-check available: the job catches exactly
the #1742 failure on current main (18 passed / 1 failed), so MERGE
ORDER MATTERS — land #1742 first or this job is red on arrival.
That red is the proof the gate works.
Co-Authored-By: Claude Fable 5 <[email protected]>
…(review)
Two review catches, both real:
- The grep hint the job carried ('Command::new("bean-') matches the
bean_price_compat suite too — which turned out to be a third
python-gated suite the job wasn't running at all. Include it
(pip install beanprice, assert bean-price --version) rather than
narrowing the hint.
- The "Fail on silent skips" step re-ran only integration_test inside
an `if`, masking a failing rerun and covering one suite. The
primary run now tees to a log (set -o pipefail so tee can't mask a
red cargo), and the skip check greps that log for every suite's
actual skip marker.
Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a dedicated CI job to ensure Rust test suites that depend on Python Beancount tooling (bean-check / bean-price) actually run (and fail) in CI rather than silently skipping when the binaries aren’t present.
Changes:
- Introduces a new
python-gated-cargo-testsjob in the Compatibility workflow. - Installs Beancount tooling via
pip, asserts the CLIs are runnable, then runs the gated cargo test suites. - Fails the job if output indicates tests skipped due to missing Python tooling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
bean-price has no --version flag — it prints usage and exits non-zero demanding sources, so the python-gated job's assert step failed on every run since #1746 landed. --help is the exact probe bean_price_compat.rs uses for its own availability gate. Co-authored-by: Claude Fable 5 <[email protected]>
What
Adds a
python-gated-cargo-testsjob to the Compatibility workflow so the cargo test suites that compare rledger against Python beancount actually run in CI — instead of silently skipping everywhere, forever.Why
Several cargo suites call
Command::new("bean-check")and skip with aneprintln!when it's missing — which is every CI environment today. The use-before-open silent-pass bug (#1742) sat on main behind exactly that skip:test_account_lifecycle_consistencyexisted, would have caught the bug, and never ran withbean-checkon PATH. This was the open question flagged in #1741/#1742.How
New job in
compat.yml(which already runs on push/PR/nightly and owns the Python setup convention):pip install beancount, then a dedicated step assertsbean-check --versionsucceeds — if the binary ever breaks, the job goes red at the assert rather than the tests green-skipping (a silent skip here would recreate the hole this job closes).rustledgerintegration_testandrustledger-coresynthetic_generation. A comment carries the grep (Command::new("bean-) that enumerates them, so the list is maintainable.Skipping: Python beancount not availablemarker — so a future availability-probe drift (renamed binary, container-based probe) can't quietly reintroduce the skip.Follows the existing job's conventions: same pinned action SHAs, same Python version, rust-cache omitted for the same license-check reason (comment cross-references it).
Land #1742 first. Verified locally with bean-check available: this job catches exactly the #1742 failure on current main (
integration_test: 18 passed / 1 failed —test_account_lifecycle_consistency;synthetic_generation: green). If this merges first, the job is red on arrival — which is the proof the gate works, but red main is red main.Also worth deciding: whether to add this job to branch protection as a required check (that's a repo-settings change only you can make).
🤖 Generated with Claude Code