testy: YAML-Based Functional Tests for Go HTTP APIs
If you've ever written functional tests for a Go HTTP server, you’ve probably found yourself stuck between two extremes:
- Writing black-box tests with curl or Postman clones (slow, no debug, hard to maintain)
- Writing verbose Go test code for every API call, mocking, assertions, cleanup, etc.
That’s why I created testy — a declarative testing framework for Go HTTP APIs, built on top of YAML and your actual http.Handler.
---
Why testy?
Here’s what makes testy different:
- ✅ Declarative tests written in plain YAML
- ✅ Real http.Handler execution — your actual app code, not a subprocess
- ✅ Full PostgreSQL fixture support via pgfixtures
- ✅ Powerful mocking, assertions, and SQL checks
- ✅ Great for debugging and stepping through real code
---
Debug Your Tests Like Real Code
Because testy runs requests through your actual Go http.Handler, you can set breakpoints in your API handlers and run tests in your IDE’s debug mode (`go test -v -run <TestName>`).
This makes test runs feel like regular request handling — not like opaque black-box e2e scripts.
You don’t need to spin up your app on a port. testy hits your router directly — whether it’s from net/http, Gin, Chi, Echo or anything else.
---
Declarative Testing With YAML
Test scenarios are written as YAML lists of steps:
golang
test
testing