Rust Testing
SkillDev toolsPatterns for Rust testing in Axone CosmWasm contracts. Use when adding unit tests, integration tests, data-driven cases, or coverage-oriented test scenarios.
Available today. Use it from your connected AI after setup.
No other account needed.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the Rust Testing skill
What this skill tells your AI
The instructions your AI receives, as published by axone-protocol/contracts in .agents/skills/rust-testing/SKILL.md and read by ahel’s review.
Coverage Targets
| Component | Target |
|---|---|
| Handlers | 100% |
| State operations | 100% |
| Error paths | 90%+ |
| Message parsing | 80%+ |
| Overall | 90%+ |
Minimum Cases to Cover
- For handlers: cover the happy path, parameter variations, error paths, and resulting state changes.
- For queries: cover empty state, populated state, pagination behavior, and non-existent items.
- For state transitions: cover initial state, updates after execute, and persistence across operations.
Running Tests
# Run all unit tests
cargo make test-unit
# Run all tests (includes integration)
cargo make test
# Run tests with coverage
cargo make test-coverage
# Run specific test
cargo test test_name -- --nocapture
Coverage output is written to lcov.info.
Viewing Coverage
# Generate HTML report (requires lcov)
genhtml lcov.info --output-directory coverage/
# Or use cargo-llvm-cov directly
cargo llvm-cov --html --open
Test Design Rules
- Isolate tests. Each test should set up its own environment.
- Test contract behavior, not framework internals.
- Assert exact errors when possible.
- Cover edge cases such as zero values, empty strings, and upper bounds.
- Prefer descriptive test names without a
test_prefix. - Use tuple-driven cases for simple matrices and structs only when the case shape needs named fields.
References
- For cw-orch integration harness patterns and common integration scenarios, read integration-patterns.
- For naming and data-driven test examples, read test-style.
Signals
- GitHub stars
- 123
- Forks
- 19
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
rust-testing-axone-protocol- Source
- github.com/axone-protocol/contracts