mcpField
R
run-rust-tests

run-rust-tests

github.com/redisearchTesting & quality6.2k58 installsUpdated today
Repository

About run-rust-tests

A skill for running Rust tests after code changes. It selects affected crates by default, or runs all tests, a chosen crate, or a specific test based on arguments.

Key features

  1. 01Detects crates affected by Rust changes
  2. 02Runs tests for selected crates
  3. 03Supports all-crate and specific-test runs
  4. 04Re-runs tests after addressing failures

Use cases

  1. 01Verify Rust changes in affected crates
  2. 02Run the complete Rust test suite
  3. 03Check a named test in a crate

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/redisearch/redisearch --skill run-rust-tests

After installing, type/run-rust-testsin Claude Code to confirm it loaded.

Details

From the project README

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

  1. Check the arguments provided above:
    • If arguments are empty, determine affected crates:
      1. Check which files were modified in src/redisearch_rs/ using git status and git diff --name-only
      2. 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)
      3. Run tests for each affected crate:
        cd src/redisearch_rs && cargo nextest run -p <crate1> -p <crate2> ...
        
      4. If no Rust files were modified in src/redisearch_rs/, or if you cannot determine affected crates, run all tests
    • If all is provided, run all Rust tests:
      cd src/redisearch_rs && cargo nextest run
      
    • If a crate name is provided, run tests for that crate:
      cd src/redisearch_rs && cargo nextest run -p <crate_name>
      
    • If both crate and test name are provided, run the specific test:
      cd src/redisearch_rs && cargo nextest run -p <crate_name> <test_name>
      
  2. 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
cd src/redisearch_rs && cargo nextest run -p hyperloglog
cd src/redisearch_rs && cargo nextest run -p inverted_index
cd src/redisearch_rs && cargo nextest run -p trie_rs

# Run a specific test
cd src/redisearch_rs && cargo nextest run -p <crate_name> <test_name>

# Run tests under miri (for undefined behavior detection)
cd src/redisearch_rs && cargo +nightly miri test

Comments

Markdown supported