Go Write Tests using Pragmatic Best Practices
summary
Practical rules for test code and CI: examples use Ginkgo/Gomega for Go and PyTest for Python, showing concrete fixes like returning errors from helpers so assertions live in the test body, reusing heavy fixtures with scope=module to avoid expensive VM rebuilds, isolating tests by cleaning state in teardown, recording test IDs into logs for traceability, marking known bugs as xfail rather than skipping, and weighing parallel runs against resource collisions and flaky randomness.
AI-written summary · about
chapters (9)
- 0:00Introduction to testing
- 1:26Testing definitions
- 3:57Test anatomy and fixtures
- 5:36Skipping and focus in tests
- 8:01Testing best practices
- 11:12Test isolation
- 13:55Visibility and traceability
- 18:07Managing shared resources
- 20:14Advanced testing patterns








