Rust Testing

🌐Community
by pproenca · vlatest · Repository

Helps with Rust, testing as part of developing backend services and APIs workflows.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add rust-testing npx -- -y @trustedskills/rust-testing
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "rust-testing": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/rust-testing"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill assists with writing high-quality tests for Rust code, particularly within the context of developing backend services and APIs using the codex-rs framework. It provides guidance on test architecture, assertions, mock servers, test data generation, event-driven testing, ensuring determinism, snapshot testing, and integration test infrastructure. The skill encodes best practices established by top codex-rs contributors to ensure consistent and effective Rust testing workflows.

When to use it

  • Writing new tests for any Rust module in codex-rs.
  • Adding regression tests when fixing bugs (typically 3-6 tests per pull request).
  • Creating integration tests that interact with the Responses API using SSE mocks.
  • Modifying TUI rendering code requiring snapshot coverage.
  • Reviewing existing test code for adherence to established codebase conventions.

Key capabilities

  • Guidance on test architecture (file organization, imports, isolation)
  • Best practices for assertions, including pretty_assertions and whole-object comparison.
  • Mock server implementation using wiremock and SSE builders.
  • Test data generation with typed construction and BTreeMap.
  • Event testing patterns involving submit/wait cycles and predicate matching.
  • Techniques for ensuring determinism, such as stable IDs and environment isolation.
  • Snapshot testing workflows utilizing the insta framework.
  • Integration test infrastructure compatible with Bazel.

Example prompts

  • "Show me how to structure a new Rust test file."
  • "How do I mock an SSE response for integration testing?"
  • "What's the best way to write assertions in my Rust tests?"

Tips & gotchas

  • Start by focusing on the "CRITICAL" rules (Test Architecture and Assertions) as they apply to all tests.
  • When writing integration tests with API mocks, prioritize the "HIGH" rules related to mock servers and test data.
  • The skill references several files for detailed guidance; consult references/_sections.md for an overview of rule categories and impact levels.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
pproenca
Installs
69

🌐 Community

Passed automated security scans.