run-rust-tests
Runs Rust unit and integration tests based on modified files to verify correctness after code changes.
Install
mkdir -p .claude/skills/run-rust-tests && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3745" && unzip -o skill.zip -d .claude/skills/run-rust-tests && rm skill.zipInstalls to .claude/skills/run-rust-tests
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Run Rust tests after making changes to verify correctness. Use this when you want to verify your changes to Rust code.Key capabilities
- →Identify affected Rust crates from git changes
- →Execute tests for specific crates using cargo nextest
- →Run all tests in the repository
- →Execute individual test functions within a crate
- →Run tests under miri for undefined behavior detection
How it works
It maps modified files to specific crates using git status and executes cargo nextest commands with appropriate manifest paths.
Inputs & outputs
When to use run-rust-tests
- →Verifying changes after refactoring
- →Running tests for a specific Rust crate
- →Executing all tests after a dependency update
- →Running a single unit test
About this skill
Rust Test Skill
Run Rust tests after making changes to verify correctness.
Arguments
- No arguments: Analyze changes and run tests for affected crates only
all: Run all Rust tests<crate>: Run tests for specific crate (e.g.,/run-rust-tests hyperloglog)<crate> <test>: Run specific test in crate (e.g.,/run-rust-tests hyperloglog test_merge)
Arguments provided: $ARGUMENTS
Usage
Run this skill after modifying Rust code to ensure tests pass.
Instructions
- Check the arguments provided above:
- If arguments are empty, determine affected crates:
- Check which files were modified in
src/redisearch_rs/usinggit statusandgit diff --name-only - Map each modified file to its crate (the directory name directly under
src/redisearch_rs/, e.g.,src/redisearch_rs/hyperloglog/src/lib.rs→hyperloglog) - Run tests for each affected crate:
cargo nextest run --manifest-path src/redisearch_rs/Cargo.toml -p <crate1> -p <crate2> ... - If no Rust files were modified in
src/redisearch_rs/, or if you cannot determine affected crates, run all tests
- Check which files were modified in
- If
allis provided, run all Rust tests:cargo nextest run --manifest-path src/redisearch_rs/Cargo.toml - If a crate name is provided, run tests for that crate:
cargo nextest run --manifest-path src/redisearch_rs/Cargo.toml -p <crate_name> - If both crate and test name are provided, run the specific test:
cargo nextest run --manifest-path src/redisearch_rs/Cargo.toml -p <crate_name> <test_name>
- If arguments are empty, determine affected crates:
- If tests fail:
- Read the error output carefully
- Fix the failing tests or the code causing failures
- Re-run tests to verify the fix
Common Test Commands
# Test specific crate
cargo nextest run --manifest-path src/redisearch_rs/Cargo.toml -p hyperloglog
cargo nextest run --manifest-path src/redisearch_rs/Cargo.toml -p inverted_index
cargo nextest run --manifest-path src/redisearch_rs/Cargo.toml -p trie_rs
# Run a specific test
cargo nextest run --manifest-path src/redisearch_rs/Cargo.toml -p <crate_name> <test_name>
# Run tests under miri (for undefined behavior detection)
cargo +nightly miri test --manifest-path src/redisearch_rs/Cargo.toml
When not to use it
- →When the environment does not support cargo nextest
Limitations
- →Limited to crates located under src/redisearch_rs/
- →Requires git status to determine affected crates
How it compares
This automates the mapping of file changes to specific crates, avoiding the need to manually identify and test affected components.
Compared to similar skills
run-rust-tests side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| run-rust-tests (this skill) | 1 | 2mo | Review | Intermediate |
| implementing-cards | 7 | 2mo | Review | Advanced |
| rust-tests-guidelines | 7 | 5mo | No flags | Beginner |
| write-rust-tests | 9 | 5mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by RediSearch
View all by RediSearch →You might also like
implementing-cards
bcollazo
Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.
rust-tests-guidelines
RediSearch
Guidelines for writing Rust tests.
write-rust-tests
RediSearch
Write Rust tests to verify correctness of Rust code.
check-rust-coverage
RediSearch
Check which Rust lines are not covered by Rust tests.
cargo-fuzz
trailofbits
cargo-fuzz is the de facto fuzzing tool for Rust projects using Cargo. Use for fuzzing Rust code with libFuzzer backend.
check-code-quality
r3bl-org
Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests. Use after completing code changes and before creating commits.