rust-testing

Generates Rust unit, integration, async, property-based tests with mocking and CI coverage integration.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/luongldptit/move-ticket --skill rust-testing-luongldptit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-testing
Source: https://github.com/luongldptit/move-ticket/tree/main/.agent/skills/rust-testing
Command: npx skills add https://github.com/luongldptit/move-ticket --skill rust-testing-luongldptit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust developers often struggle with writing consistent, maintainable tests that follow industry best practices, leading to flaky test suites, low code coverage, and missed bugs early in the development cycle.

Core Features & Use Cases

  • TDD Workflow Guidance: Step-by-step RED-GREEN-REFACTOR cycle tailored specifically for Rust projects to enforce test-first development.
  • Comprehensive Test Patterns: Covers unit tests, integration tests, async tests with Tokio, property-based testing with proptest, and mocking with mockall for dependency isolation.
  • Coverage & CI Integration: Includes instructions for running test coverage with cargo-llvm-cov and setting up GitHub Actions pipelines to enforce quality gates like 80% coverage thresholds.
  • Use Case Example: A Rust backend developer can use this skill to implement TDD for a new API endpoint, write parameterized tests for edge cases, and set up CI to fail builds if coverage drops below the required threshold.

Quick Start

Use the rust-testing skill to write a failing unit test for your new Rust function as the first step of a TDD workflow.

Frequently Asked Questions about rust-testing

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

FAQPage Schema
How do I set up a TDD workflow for my Rust project?

To set up TDD in Rust, follow a structured RED-GREEN-REFACTOR cycle tailored for Rust projects, writing a failing unit test first before implementing the function logic to enforce test-first development.

What's the best way to mock dependencies in Rust unit tests?

The best way to mock dependencies in Rust is using the mockall configuration pattern, which provides standardized testing patterns for dependency isolation to eliminate inconsistent, low-coverage test suites.

How do I measure Rust test coverage and enforce it in CI?

Measure Rust test coverage using cargo-llvm-cov and enforce it by setting up GitHub Actions pipelines with quality gates, such as failing builds if coverage drops below an 80% threshold.

Can I write async tests and property-based tests in Rust?

Yes, you can implement async tests with Tokio and property-based testing with proptest using standardized Rust testing patterns to cover edge cases and improve code reliability.

How do I structure integration tests and unit tests in Rust?

Structure Rust tests by separating unit test authoring and integration test setup using standardized patterns, ensuring proper dependency isolation and adherence to Rust testing best practices to reduce flaky tests.