Reusable Bake tasks for running Rust tests and testing downstream repositories against local Cargo workspace packages.
Rust provides a good test runner through Cargo, but it does not provide a shared
way to prepare project resources or exercise selected downstream crates. This
package gives Rust projects a consistent bake test, bake test:coverage,
and bake test:external interface while keeping Cargo and cargo-llvm-cov as
the test runners.
Add the task crate to the private bake/ package:
[dependencies]
bake-test-rust = "0.2"Link its tasks from bake/src/main.rs:
use bake_test_rust as _;Then run the workspace tests:
cargo bake test
cargo bake test:coverage
cargo bake test:externalThe coverage task runs documentation tests and requires 100% line coverage for
the selected workspace test configuration. It prints uncovered source lines
when the gate fails. Install cargo-llvm-cov first; see the
Rust Testing guide for feature selection and architecture
notes. Use --package name to limit a workspace run to one package.
Configure downstream repositories in the root Cargo.toml:
[[workspace.metadata.bake.test.external]]
repository = "https://github.com/socketry/downstream-project"
branch = "main"See the Rust Testing guide for the test:before hook,
checkout reuse, Cargo patching, and canonical GitHub Actions workflows.
This crate publishes context files for coding agents. Configure Bake Agent
Context in your private bake/ crate, then run
cargo bake agent:context:install --package bake-test-rust to install the
package's testing guidance for agents. See the Bake Agent Context guide for
installation details.
Prepare a release with cargo bake cargo:version:patch (or minor, major,
or bump --version X.Y.Z), then run cargo bake cargo:release and open a
pull request. After review and merge, GitHub Actions publishes the release
when the configured crates-io environment approves it. See the
Cargo publishing guide.
See releases.md for the full release history.
- Add a Bake task for 100% line coverage with missing-line output.
- Update downstream lockfiles after applying local workspace patches.
- Fix the Bake task name so
cargo bake testinvokes the workspace test task.
-
bake-test-rust — Reusable Rust test tasks for Bake
Please open an issue or pull request on GitHub.