Rust Test
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Run a Rust project’s tests, whether a single crate or a Cargo workspace (a command-line tool with src/lib.rs plus a thin src/main.rs, an xtask member, a library), scope the run to what the caller asked for, and report a compact pass/fail summary. It is a read-only reporting skill: it never fixes a failing test, edits source or test code, updates Cargo.lock, installs tools, or starts containers unless asked to as a follow-up.
Purpose
iru-rust-test surveys the workspace with cargo metadata, always passes --locked when a Cargo.lock exists, and picks the runner: cargo-nextest when installed (JUnit XML through the project’s own junit profile or an injected iru-rust-test profile) and cargo test otherwise (libtest console output parsed). Doctests run separately through cargo test --doc, because nextest cannot run them and bin-only crates have none. #[ignore = "…"] tests, this catalog’s marker for container or network-backed tests, are excluded by default and run only on request, serialized repository-wide behind the shared .integration-test.lock. A filter that matched nothing, a build failure, a stale Cargo.lock, a bad package: name and an unavailable Docker daemon are each reported plainly, never as "0 passed".
When the workspace has a Ratatui terminal UI (or ui: yes), Step 2a also handles the UI contract’s text captures (see Building user interfaces): it sets UI_SCREENSHOTS_DIR for the tests (default <repo root>/.ui-screenshots), clears that directory at the start of a full (unfiltered) run only, validates every capture name against <kind>/<Id>/<state>--<direction>--<theme>[--<variant>…].txt|png, and reports captures per kind, malformed names and accessibility violations by rule id at the .ui-quality.yml level.
Plugin
Shipped by the iru-rust plugin of the ai-catalog marketplace (install with /plugin install iru-rust@ai-catalog; see Plugins).
Invocation
/iru-rust-test
/iru-rust-test <filter> [<filter> ...]
/iru-rust-test expr:<nextest filterset>
Optional key: value lines may follow the filters.
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Zero or more positional test-name substrings (OR-ed), or one nextest filterset prefixed |
Every test in the selection. |
|
No |
Run one workspace member ( |
Every member ( |
|
No |
Narrow to unit tests of the library, unit tests of the binaries, every test target, doctests only, or one integration test file by stem ( |
Everything, doctests included. |
|
No |
|
The default features; the report says which ran. |
|
No |
Whether |
|
|
No |
Passed by a calling skill that already holds |
Not set; the skill takes the lock itself for ignored selections. |
|
No |
Whether the terminal-UI capture step applies. |
|
Outputs
-
A plain-text summary in the conversation: the runner and selection used (for example cargo-nextest with the injected profile,
--workspace, default features, ignored tests excluded), the pass, fail, error, skipped and flaky counts, and the doctest result reported separately ("no doctests" for a bin-only crate). -
For each failure, the binary and test path with one cause line, usually the assertion text and its
file:line. Flaky (retried) tests are reported apart from hard failures. -
A filter that matched nothing (nextest exit
4, orcargo testwith all-zero counts), a build failure (firsterror[E…]line and file), a stale or missingCargo.lock, and a badpackage:are each stated plainly. -
For
ignored: includeoronly: whether the lock was acquired, waited for, or held by the caller. An ignored selection that could not run is reported as unverified (Docker unavailable, blocked by a concurrent run, test service unreachable), never as passed or failed. -
For a terminal UI (Step 2a): the captures directory and whether it was cleared (full run) or kept (scoped run), captures per kind (
component,screen,flow), malformed capture names (count plus the first few paths), accessibility violations as counts per rule id (tui-color-only,tui-help-line,tui-keyboard,tui-no-color), and the.ui-quality.ymllevel applied (enforcewhen the file is missing). These are asserted checks, not an automated audit. -
Logs and the JUnit report are left under
target/iru-rust-test/andtarget/nextest/(gitignored). No source or test code is ever modified.
Execution flow
Dependencies
Invokes
None — iru-rust-test is a leaf skill; it only runs cargo commands and a small Python parser, and reports on their output.
Invoked by
-
Rust Code One Task Group — scoped tests per task, the full test run, and the container-backed
#[ignore]run (withlock: heldwhen it holds the lock), via theiru-gate-runneragent.
Its test-runner choice and Step 3 lock protocol are also reused by Rust Coverage.
Related agents
-
iru-gate-runner— calling skills normally run it inside this sub-agent. It spawns no agents itself.
Source
SKILL.md on GitHub — the file this page was generated from.