I was wondering what the best practice is regarding databases for integration tests on the build server. If there is a best practice.
Currently, our build will create a new database from scratch for every build. Integration tests are then performed against this.
However, as the project has a long history, and continues to grow, the amount of migration scripts (using EF Code First migrations) increases. This is starting to slow down the build.
One solution would be to no longer recreate the database for every build. A possible down-side of that is that you could have to manually revert certain changes that were pushed to the (Git) repository but were deemed wrong afterwards (or even fail the build).
Another solution is to restore a backup of a database at a known point and perform any subsequent migrations every time. All we need to do then is update the reference point regularly. But this, again, is manual work.
Actually, this is how we're currently doing it, but I wondered if there were any other or better strategies.