Skip to content

ci: run Test and Doctests over every workspace member - #2965

Merged
robcohen merged 1 commit into
mainfrom
fix/ci-test-all-workspace-members
Nov 12, 2026
Merged

robcohen merged 1 commit into
mainfrom
fix/ci-test-all-workspace-members

Conversation

@robcohen

@robcohen robcohen commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What

  • Test (ci matrix): cargo nextest run --workspace --all-features --exclude rustledger-ffi-component-tests (was cargo nextest run --all-features).
  • Doctests: cargo test --workspace --doc --all-features (was cargo test --doc --all-features).
  • New step Tests left the checkout clean after Test: fails if git status --porcelain is non-empty.
  • .github/workflows/ci.yml added to the code path filter in changes.

Why

Without --workspace, cargo acts on default-members, which leaves out rustledger-wasm, rustledger-ffi-wasi, rustledger-ffi-component and rustledger-ffi-component-tests. Their native tests, including the drift guards (convert::check_parity, query_option_parity, surface_agreement, the ffi-wasi property tests, the wasm cost_number_wire_parity / wasm_surface_agreement tests, and parse_error_mapping_parity coming with #2946), ran only on developer machines. #2962 fixed the same gap for Check, Clippy and Documentation.

Decisions:

  • rustledger-ffi-component-tests is excluded from Test. Without the built wasip2 component its tests print a skip marker and pass on zero assertions. The Component Parity (wasip2) job builds the component, runs those tests, and fails on the marker, so it already covers them. Its doctests are included in Doctests (it has none; the binary reports 0, which is harmless).
  • ts-export / json-schema stay on (--all-features). The ts-export tests write per-type .d.ts files only under the gitignored crates/rustledger-wasm/bindings/bindings/. The JSON Schema export test, the only one that writes a tracked file, is #[ignore] and additionally refuses to run without RUSTLEDGER_REGEN_SCHEMA=1. The checked-in bindings already have a freshness gate (bindings-fresh runs RUSTLEDGER_TS_CHECK=1 scripts/regen-bindings.sh, which also needs prettier and datamodel-code-generator), so the Test job does not duplicate it; instead the new clean-checkout step guarantees that no test, now or later, rewrites a tracked file without CI noticing.
  • Path filter. A PR touching only ci.yml computed should_build=false, so this very PR would have skipped Test and Doctests and merged the new commands untried. ci.yml is now part of the code filter, so a change to this workflow's cargo commands runs them.

How tested

Locally (nix develop, rustc 1.98.1, RUST_MIN_STACK=8388608 as in CI):

  • cargo nextest run --workspace --all-features --exclude rustledger-ffi-component-tests: 6773 passed, 6 skipped (was 6480 / 4 on default-members). git status --porcelain clean afterwards.
  • cargo test --workspace --doc --all-features: all pass (rustledger-wasm, rustledger-ffi-wasi, rustledger-ffi-component and ffi-component-tests currently have no runnable doctests, so this mostly guards future ones).
  • cargo fmt --all -- --check: clean.

No test in the newly covered crates failed on the host target; no extra rustup target is needed.

Runtime impact

  • New tests: 293 across 17 binaries in the three crates; they run in about 1.4 s locally.
  • The extra cost is compiling and linking those 17 test binaries plus the crates' dev-only deps (wit-component, wasm-bindgen-test, ts-rs, schemars). Check and Clippy already build these crates with --workspace, so sccache is warm for the library parts.
  • CI, this PR: Test job 13m38s (build 11m10s at a 48.8% sccache Rust hit rate, first run with the new test binaries; execution 116s for 6773 tests). Recent runs on main/PRs: Test job 7.5 to 10 min, build 4m52s to 9m11s depending on sccache hit rate (97% down to 26%), execution 78 to 124s for about 6480 tests. So test execution is unchanged within noise; the added cost is compiling the extra test binaries, which should shrink once sccache holds them (Check and Clippy already compile these crates). Doctests: 3m23s here vs 1 to 4 min before.
  • Memory: no new heavy test binaries; the added crates are small relative to the rustledger CLI and LSP test builds that already run in this job.

Closes #2963

🤖 Generated with Claude Code

The Test (`cargo nextest run`) and Doctests (`cargo test --doc`) jobs
acted on `default-members` only, so the native tests of rustledger-wasm,
rustledger-ffi-wasi and rustledger-ffi-component, including the drift
guards that pin those surfaces to the canonical pipeline, never ran in CI.

- Test: `--workspace --exclude rustledger-ffi-component-tests`; that
  crate needs the built wasip2 component and is run, with a skip-marker
  check, by the Component Parity (wasip2) job.
- Doctests: `--workspace`.
- New step after Test fails if the run left the checkout dirty.
  `--all-features` enables rustledger-wasm's `ts-export`, whose tests
  write only the gitignored `bindings/bindings/`; the JSON Schema export
  is `#[ignore]` and env-gated, and the `bindings-fresh` job already
  diffs the checked-in bindings.
- Add `.github/workflows/ci.yml` to the `code` path filter so a PR that
  changes only this workflow's cargo commands still runs them.

Closes #2963

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@robcohen
robcohen requested a review from a team as a code owner November 12, 2026 14:05
@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 826
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 Nov 12, 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 a4d53b6 into main Nov 12, 2026
48 of 49 checks passed
@robcohen
robcohen deleted the fix/ci-test-all-workspace-members branch November 12, 2026 14:27
robcohen added a commit that referenced this pull request Nov 12, 2026
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.

ci: Test and Doctests jobs skip rustledger-wasm and the FFI crates

1 participant