Go library to spawn single-use MySQL / MariaDB servers for unit testing
Spawns a MySQL / MariaDB server with a single database configured. Ideal for unit tests where you want a clean instance each time. Then clean up afterwards.
Features:
- Starts a clean isolated MySQL / MariaDB database
- Tested on Fedora and Ubuntu
In your unit test:
mysql, err := mysqltest.Start()
defer mysql.Stop()
// Do something with mysql.DB (which is a *sql.DB)
This library is distributed under the MIT license.