How tanasoft1/testkit works
testkit is a shared Go test harness for exercising real service HTTP handlers against isolated, migrated Postgres databases, while also recording outbound HTTP calls. The principal workflow is a test obtaining a fresh database, wiring its application to that database, issuing in-process requests through a framework adapter, then checking responses and assertions. Separate capabilities cover Postgres server discovery and container fallback, schema migration, outbound-call recording, and Fiber or net/http integration. The source excerpts show the core runtime paths; links among unsampled service wiring and outbound clients are documented in the README rather than verified in service code.
Main entry points: server.go Server resolver · doer.go Doer seam · fiberkit.go Fiber adapter · httpkit.go net/http adapter
Components 13
Database harness
- Server resolver
pgkit/server.go - Schema migrator
pgkit/migrator.go
HTTP testing
- HTTP client
client.go - Doer seam
doer.go - Fiber adapter
fiberkit/fiberkit.go - net/http adapter
httpkit/httpkit.go
Test verification
- TLS recorder
recorder.go - Assertions
assert/assert.go
Other components
- Service test
- Real application
- Postgres server
- Docker fallback
- Outbound endpoint
Connections 15
- Service test → Server resolver: requests database
README.md - Server resolver → Postgres server: resolves server
pgkit/server.go - Server resolver → Docker fallback: boots fallback
pgkit/server.go - Server resolver → Schema migrator: uses migrator
pgkit/server.go - Schema migrator → Postgres server: migrates template
pgkit/migrator.go - Service test → Real application: wires with DSN
README.md - Service test → HTTP client: issues requests
README.md - HTTP client → Doer seam: dispatches request
client.go - Fiber adapter → Real application: wraps Fiber app
fiberkit/fiberkit.go - net/http adapter → Real application: serves handler
httpkit/httpkit.go - Fiber adapter → Doer seam: implements seam
fiberkit/fiberkit.go - net/http adapter → Doer seam: implements seam
httpkit/httpkit.go - Real application → Outbound endpoint: calls endpoint
README.md - Service test → TLS recorder: configures recorder
README.md - Service test → Assertions: checks results
README.md