Thank you for your interest in contributing!
git clone https://github.com/kerlenton/kata
cd kata
go test ./...# all tests
go test ./...
# with race detector (always run this before submitting a PR)
go test -race ./...
# with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# benchmarks
go test -bench=. -benchmem ./...Tests live alongside source files (standard Go convention). Each module has its own test file:
| File | What it covers |
|---|---|
common_test.go |
Shared helpers: testState, mkStep, mkComp, assertions |
runner_test.go |
Sequential execution, compensation order, context cancellation |
parallel_test.go |
Concurrent groups, partial failure, rollback from later steps |
retry_test.go |
Retry logic, Exponential, Fixed, Jitter, Cap, overflow |
hooks_test.go |
All lifecycle hooks including OnRetry |
bench_test.go |
Benchmarks for sequential, parallel, compensation, policies |
When adding a new feature, put tests in the file that matches the module. If you're adding a new module (e.g. circuit.go), create a corresponding circuit_test.go.
- Keep zero dependencies. The core library (
katapackage) must have no external dependencies. Examples may use whatever they need. - All public API must be documented. Every exported type, function, and method needs a godoc comment.
- Tests for every feature. New behaviour requires new tests. Bug fixes require a regression test.
- Benchmarks for hot paths. If your change affects step execution, retry, or compensation, run
go test -bench=. -benchmembefore and after to check for regressions. - Run
go vetandgolangci-lintbefore submitting. The CI will catch it anyway, but saves time.
- Fork the repo and create a branch from
main - Make your changes
- Add or update tests
- Run
go test -race ./...- all tests must pass - Update
CHANGELOG.mdunder[Unreleased] - Open a pull request with a clear description of what and why
Open an issue with:
- Go version (
go version) - A minimal reproducer
- Expected vs actual behaviour