Rust Testing
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.
Run in terminal (recommended)
claude mcp add rust-testing npx -- -y @trustedskills/rust-testing
Or manually add to ~/.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_assertionsand whole-object comparison. - Mock server implementation using
wiremockand 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
instaframework. - 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.mdfor 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 Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.