본문으로 건너뛰기
cccskills
무료GitHub에 공개

rust-testing

Patterns for Rust testing in Axone CosmWasm contracts. Use when adding unit tests, integration tests, data-driven cases, or coverage-oriented test scenarios.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(3)

  • SKILL.md2.0 KB
  • references/integration-patterns.md3.3 KB
  • references/test-style.md2.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Rust Testing

Coverage Targets

ComponentTarget
Handlers100%
State operations100%
Error paths90%+
Message parsing80%+
Overall90%+

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

  1. Isolate tests. Each test should set up its own environment.
  2. Test contract behavior, not framework internals.
  3. Assert exact errors when possible.
  4. Cover edge cases such as zero values, empty strings, and upper bounds.
  5. Prefer descriptive test names without a test_ prefix.
  6. 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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Best practices for designing CosmWasm smart contract APIs. Use when defining message types, designing execute/query interfaces, or optimizing API ergonomics.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

axone-protocol/contracts1232026년 10월 14일 업데이트

Guide for writing Rust doc comments that produce accurate generated contract documentation. Use when editing Instantiate/Execute/Query/Response types or any public schema-facing API.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

axone-protocol/contracts1232026년 10월 14일 업데이트

Guide for writing conventional commit messages. Use when committing changes, writing commit messages, or reviewing commit history.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

axone-protocol/contracts1232026년 10월 14일 업데이트

Axone contract structure and Abstract SDK patterns. Use when scaffolding or refactoring contracts, deciding layer boundaries, wiring AppContract entrypoints, or adding module metadata and replies.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

axone-protocol/contracts1232026년 10월 14일 업데이트

Axone deployment workflows with cargo-make, cw-orch, and Abstract. Use when publishing modules, installing them on accounts, running local chain tasks, or inspecting deployments.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

axone-protocol/contracts1232026년 10월 14일 업데이트

Guide for regenerating Axone contract schemas and rendered Markdown docs. Use when contract APIs or metadata change, when checking generated-doc drift, or when preparing documentation commits.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

axone-protocol/contracts1232026년 10월 14일 업데이트

axone-protocol의 스킬 모두 보기

이 스킬의 문제 신고