Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.23 KB

testing-guide.md

File metadata and controls

44 lines (31 loc) · 1.23 KB

Testing Guide

Coverage Requirements

Strive for near 90% test coverage where practical.

Testing Approaches

  • Unit tests: Core logic, pricing functions, parsing, validation.
  • Property-based tests: Use pgregory.net/rapid for invariants across wide input domains.
  • Golden tests: View rendering, serialization format snapshots.
  • Integration tests: End-to-end workflows with fake providers.

Commands

# Single package
make unit pkg=<package> case=<test> timeout=5m

# Debug with logs
make unit log="stdlog trace" pkg=<package> case=<test>

# System-level end-to-end test
make systest

Pre-Commit Checklist

Before every commit, run:

  1. make tidy-module-check — verify module files are tidy.
  2. make unit pkg=$pkg case=$case timeout=5m — run unit tests.
  3. make unit log="stdlog trace" pkg=$pkg case=$case — run with debug logs.
  4. Check logs carefully:
    • Verify structured logging format is correct.
    • Ensure no log spam.
    • No [ERR] lines should appear unless testing error paths.
  5. make systest — run affected system-level end-to-end tests.

Test Naming

Use TestExecTxJoinOuterActorTx not TestExecTx_JoinOuterActorTx. No underscores in Go test function names.