Our great sponsors
-
dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
You can use a library like dockertest to spin up a real database instance for just testing the repository. Would be closer to an integration test but better than no tests.
I mostly just do integration tests, meaning spinning up the whole service utilizing testcontainers-go for postgres/redis. My main.go file is small and I just start the service in the test code and test using my integration test framework (https://github.com/Eun/go-hit).