Our great sponsors
-
keploy
Test generation for Developers. Generate tests and stubs for your application that actually 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.
Another approach could be to capture real DB traffic (either from production or local) and then use that as a mock for your tests. This way it can isolate external variables from your tests as mentioned by other folks in this thread. I also wrote a tool for this - keploy
The first one is TestMain, which could improve the lifecycle management of the container. The second one is DATA-DOG/go-txdb, this allows you to open a new db connection running in a transaction, so each test could have its own isolated DB connection.