cargo-test

Run Rust tests with cargo nextest for filtering, retries, and profiling.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/fasterthanlime/_claude --skill cargo-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cargo-test
Source: https://github.com/fasterthanlime/_claude/tree/main/skills/cargo-test
Command: npx skills add https://github.com/fasterthanlime/_claude --skill cargo-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Encourages using cargo nextest instead of cargo test for better test output, filtering, retries, and profiling, improving reliability and observability in Rust test suites.

Core Features & Use Cases

  • Nextest Run: Superior test execution with filtering, retries, and profiling capabilities.
  • Output & Capture: Flexible capture options and status levels for clearer results.
  • Wrappers & Profiles: Wrapper scripts and profiles to instrument tests (e.g., with valgrind or perf).

Quick Start

Replace cargo test with cargo nextest run in your workflow, e.g., cargo nextest run -p your_package.

Frequently Asked Questions about cargo-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve Rust test output and reliability with cargo nextest?

Cargo nextest replaces cargo test to provide superior test output, filtering, retries, and profiling. Install cargo-nextest, configure nextest.toml, then run `cargo nextest run` instead of `cargo test` to gain better visibility and control over unit and integration tests.

Can I filter and retry specific Rust tests with cargo nextest?

Yes. Cargo nextest supports filtering tests by package and name, and enables retry policies through profiles and filtersets defined in nextest.toml. Use `cargo nextest run` with filtering options to execute targeted subsets and automatically retry failed tests.

How do I instrument Rust tests with profiling tools like valgrind or perf?

Cargo nextest allows wrapper scripts and custom profiles in nextest.toml to instrument test execution. Configure run-wrapper or list-wrapper to invoke profiling tools like valgrind or perf, enabling advanced observability without modifying test code.

What's the best way to set up cargo nextest for CI and local Rust development?

Install cargo-nextest, create nextest.toml with profiles and filtersets, then replace `cargo test` with `cargo nextest run` in both local workflows and CI pipelines. This applies to unit and integration tests across packages with consistent filtering and output control.

Does cargo nextest work with package filtering in multi-crate Rust projects?

Yes. Cargo nextest supports package-level filtering via `-p` flag and filtersets in nextest.toml. Use `cargo nextest run -p your_package` to run tests for specific crates in monorepos or multi-package workspaces.