Strive for near 90% test coverage where practical.
- Unit tests: Core logic, pricing functions, parsing, validation.
- Property-based tests: Use
pgregory.net/rapidfor invariants across wide input domains. - Golden tests: View rendering, serialization format snapshots.
- Integration tests: End-to-end workflows with fake providers.
# 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 systestBefore every commit, run:
make tidy-module-check— verify module files are tidy.make unit pkg=$pkg case=$case timeout=5m— run unit tests.make unit log="stdlog trace" pkg=$pkg case=$case— run with debug logs.- Check logs carefully:
- Verify structured logging format is correct.
- Ensure no log spam.
- No
[ERR]lines should appear unless testing error paths.
make systest— run affected system-level end-to-end tests.
Use TestExecTxJoinOuterActorTx not TestExecTx_JoinOuterActorTx. No
underscores in Go test function names.