Climbing the Testing Pyramid: From Real Service to Interface Mocks in Go
summary
Tests target an S3-bucket-creation function with retry logic and show concrete setups: proxying real AWS through Toxiproxy to inject a 30s latency toxic, running against a local emulator via LocalStack, and using Go’s httptest plus TLS-capable clients for HTTP mocks. Interface-based mocks are demonstrated with call-count logic and generated mocks from Mockery that return errors twice then succeed on the third call; all demos run and validate retries and cleanup.
AI-written summary · about
chapters (11)
- 0:00Testing cloud dependencies
- 3:32Real cloud services testing
- 7:44Failures with ToxiProxy
- 17:18Validating retries through log inspection
- 21:35Service emulators like LocalStack
- 29:59Emulator limitations
- 30:41HTTP test mocking
- 37:02Closed-source dependency challenges
- 38:06Interface mocks in Go
- 44:34Mockery for mock generation
- 47:25Choosing testing strategy
related talks
04mMocking in Go: Using interfaces for fun and profits
20mWriting Microservice Integration Tests in Go (Finally)
50mThe Best Mock in the World: Examining Tools for Generating Mocks in Go
34mAdvanced Testing Techniques in Go
31mFake It to Make It! - TDD of gRPC Microservices
49mFor those about to Mock I salute you!
50mThe best mock in the world: examining mock generation tools in Go
27mEffectively Testing Services
