Back to Skills

cargo-nextest

verified

Next-generation test runner for Rust with parallel execution, advanced filtering, and CI integration. Use when running tests, configuring test execution, setting up CI pipelines, or optimizing test performance. Trigger terms: nextest, test runner, parallel tests, test filtering, test performance, flaky tests, CI testing.

View on GitHub

Marketplace

laurigates-plugins

laurigates/claude-plugins

Plugin

rust-plugin

language

Repository

laurigates/claude-plugins
3stars

rust-plugin/skills/cargo-nextest/SKILL.md

Last Verified

January 24, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/laurigates/claude-plugins/blob/main/rust-plugin/skills/cargo-nextest/SKILL.md -a claude-code --skill cargo-nextest

Installation paths:

Claude
.claude/skills/cargo-nextest/
Powered by add-skill CLI

Instructions

# cargo-nextest - Next-Generation Test Runner

cargo-nextest is a faster, more reliable test runner for Rust that executes each test in its own process for better isolation and parallel performance.

## Installation

```bash
# Install cargo-nextest
cargo install cargo-nextest --locked

# Verify installation
cargo nextest --version
```

## Basic Usage

```bash
# Run all tests with nextest
cargo nextest run

# Run specific test
cargo nextest run test_name

# Run tests in specific package
cargo nextest run -p package_name

# Run with verbose output
cargo nextest run --verbose

# Run ignored tests
cargo nextest run -- --ignored

# Run all tests including ignored
cargo nextest run -- --include-ignored
```

## Configuration File

Create `.config/nextest.toml` in your project root:

```toml
[profile.default]
# Number of retries for flaky tests
retries = 0

# Test threads (default: number of logical CPUs)
test-threads = 8

# Fail fast - stop on first failure
fail-fast = false

# Show output for passing tests
success-output = "never"  # never, immediate, final, immediate-final

# Show output for failing tests
failure-output = "immediate"  # never, immediate, final, immediate-final

[profile.ci]
# CI-specific configuration
retries = 2
fail-fast = true
success-output = "never"
failure-output = "immediate-final"

# Slow test timeout
slow-timeout = { period = "60s", terminate-after = 2 }

[profile.ci.junit]
# JUnit XML output for CI
path = "target/nextest/ci/junit.xml"
```

## Test Filtering with Expression Language

```bash
# Run tests matching pattern
cargo nextest run -E 'test(auth)'

# Run tests in specific binary
cargo nextest run -E 'binary(my_app)'

# Run tests in specific package
cargo nextest run -E 'package(my_crate)'

# Complex expressions with operators
cargo nextest run -E 'test(auth) and not test(slow)'

# Run all integration tests
cargo nextest run -E 'kind(test)'

# Run only unit tests in library
cargo nextest run -E 'kind(lib) and test(/)'
```

### Expression Op

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6956 chars