Skip to content

fix(test): gate the WASM fixture helper behind python-plugin-wasm - #2595

Merged
robcohen merged 1 commit into
mainfrom
fix/cli-test-dead-code
Oct 11, 2026
Merged

robcohen merged 1 commit into
mainfrom
fix/cli-test-dead-code

Conversation

@robcohen

Copy link
Copy Markdown
Member

wasm_plugins_dir() in crates/rustledger/tests/cli_commands_test.rs is only called from tests gated on python-plugin-wasm. Without that feature, the lint on the release configuration fails on main:

cargo clippy -p rustledger --no-default-features --features mimalloc,ag-rledger --all-targets -- -D warnings
error: function `wasm_plugins_dir` is never used

The required build check doesn't compile that configuration, so this went unnoticed. This PR gates the helper with the same #[cfg(feature = "python-plugin-wasm")] as its callers. Test-only; no behavior change.

Verified: that clippy command fails on main and passes with this change, and the all-features clippy still passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr

cli_commands_test's wasm_plugins_dir() is only called from tests behind
python-plugin-wasm, so the release-config lint (--no-default-features
--features mimalloc,ag-rledger --all-targets -D warnings) failed on main
with dead code. Gate the helper like its callers.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
@robcohen
robcohen requested a review from a team as a code owner October 11, 2026 02:09
@github-actions

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Shape rustledger beancount Speedup RSS (rledger / beancount)
simple 50.8ms ± 5.1ms 689.8ms ± 9.9ms 13.6x 51.2 MB / 50.1 MB
investment 78.4ms ± 0.9ms 2462.4ms ± 14.5ms 31.4x 57.1 MB / 58.0 MB
fifo 76.5ms ± 0.7ms 13644.8ms ± 242.2ms 178.4x 55.3 MB / 57.8 MB

vs base, measured in this run

Shape base this PR Change RSS base → PR
simple 49.4ms ± 1.1ms 50.8ms ± 5.1ms +2.8% ✅ within noise 51.1 MB → 51.2 MB (+0.2%)
investment 78.9ms ± 0.6ms 78.4ms ± 0.9ms -0.6% ✅ within noise 57.2 MB → 57.1 MB (-0.2%)
fifo 76.1ms ± 0.7ms 76.5ms ± 0.7ms +0.5% ✅ within noise 57.1 MB → 55.3 MB (-3.2%)

A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: simple 2.3ms, investment 0.5ms, fifo 0.4ms), and is at least 5%.
10,000 transactions per shape · 20 runs, 3 warmup · hyperfine

What do these numbers mean?
  • simple — Two-posting transfers, one currency. The historical workload — keep as the floor, not as the benchmark.
  • investment — Cost specs, per-unit prices and lot reductions. Exercises booking and inventory, which simple leaves at 0.3%.
  • fifo — Bare {} reductions against a FIFO account — how FIFO sells are normally written. The other four shapes reach the ordered-selection path twice in 2k transactions between them, so it was effectively unprofiled until it turned out to be quadratic (plan_ordered scans every lot per reduction: FIFO ledgers are quadratic (8.8s at 20k transactions) #2083).
  • vs base: the PR and the base-branch commit it is built on, built and measured in the same job
  • RSS: peak resident set size, a single sample — reported without a verdict because there is no spread to test it against
  • A shape with no beancount column is one bean-check reports errors on; it is timed for rledger only

@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100% (raw 93%, 179 masked)
Full AST Match 100%
Total Files 819
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@robcohen
robcohen merged commit 23e161d into main Oct 11, 2026
48 checks passed
@robcohen
robcohen deleted the fix/cli-test-dead-code branch October 11, 2026 03:50
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