4 ms·
With Hibernate we used to connect it to a in memory DB just for the tests and to a real DB for production. It was easy and quick to drop schemas.
by gerbilly 10y ago
With Hibernate we used to connect it to a in memory DB just for the tests and to a real DB for production.
It was easy and quick to drop schemas.
- kevinburke 10y agoI agree that would be faster, but we rely a lot on Postgres's database constraints and we've previously had code problems go undiagnosed when the test schema didn't match production. Six in one, half a dozen in the other, I guess.
- jwatte 10y agoWhy does your test infrastructure allow a schema that doesn't match production? Seems like low hanging fruit there!
- kevinburke 10y agoSorry - that was a few months ago, we replaced it as soon as feasible. We had to upgrade a lot of tests to make it work with our prod schema
- jwatte 10y agoRight. In the best of worlds, your tests just apply the production schema update on start, and similarly you apply checked in schemas ASAP to production after passing tests!