If you write database driven applications, you probably have used SQLite at some point. Since it is a simple embedded database, it is a logical choice to use for unit tests that go to the database. However, SQLite performance on Ext4 (default Fedora File system) is lack-luster.
A cheap way to speed things up is to use a ramdisk as the backing store for the database.
Openstack Keystone runs unit tests against a database stored in the keystone/tests directory. A typical unit test run gives times like this:
Ran 455 tests in 369.486s
Six minute test runs really mess with your flow.
The easiest way to speed things up is to make this into a ramdisk.
— UPDATE database is now in tests/tmp–
sudo mount -t tmpfs -o size=256M tmpfs /opt/stack/keystone/tests/tmp # this line is not needed --> sudo chown $USER /opt/stack/keystone/tests cd /opt/stack/keystone/ git checkout HEAD tests/tmp
Ran 456 tests in 27.262s
Yes, I will take a factor 12 speed up, thank you very much.