DistributedProofreaders / dproofreaders

Distributed Proofreaders is a web application intended to ease the process of converting public domain books into e-texts.
https://www.pgdp.net
GNU General Public License v2.0
46 stars 28 forks source link

Ensure unittests are run against a test-only DB #1207

Closed cpeel closed 1 month ago

cpeel commented 1 month ago

When running unit tests, run them against a test DB instead of the real DB. This doesn't impact the CI at all, but does help when running unit tests on the TEST server. While the tests try to clean up after themselves, it's impossible to do so cleanly, for instance the crazy high round page counts.

One downside to this approach on TEST is that its possible the databases will drift. It's easy enough to drop and recreate the database however if the unit tests fail because of said drift.