Our great sponsors
- ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
- CodiumAI - TestGPT | Generating meaningful tests for busy devs
- InfluxDB - Access the most powerful time series database as a service
- SonarLint - Clean code begins in your IDE with SonarLint
GoMock is a mocking framework for the Go programming language. (by golang)
Normally I like to generate everything with Mockgen and test it using table driven test.
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
If your project is relatively simple and you can get away with recreating your scenarios against a real mock database and run other related services locally. It would be good to setup docker containers for your test scripts and write e2e tests. I believe e2e tests are harder but more useful in understanding/reasoning how users are impacted.
ONLYOFFICE Docs — document collaboration in your environment. Powerful document editing and collaboration in your app or environment. Ultimate security, API and 30+ ready connectors, SaaS or on-premises
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
If you had bit more complex workflows or less time - you could start using a VCR library to mock out API interactions and then continue with your dockerised DBs.
How to unit test your database interactions with Docker
4 projects | reddit.com/r/golang | 24 Mar 2023
how to mock DBs
13 projects | reddit.com/r/golang | 30 May 2022
[HELP] Testing SQL queries and functions that use SQL queries in Golang.
3 projects | reddit.com/r/golang | 1 Dec 2021
How to start a Go project in 2023
21 projects | news.ycombinator.com | 23 May 2023
Go: Write Mock Test cases using Mockery and
1 project | dev.to | 10 May 2023