3 ms·
Last month I was working on something that involved very complex SQL queries using recursive CTE https://www.postgresql.org/docs/current/queries-with.html http
by PaulHoule 3y ago
Last month I was working on something that involved very complex SQL queries using recursive CTE
https://www.postgresql.org/docs/current/queries-with.html https://www.postgresql.org/docs/current/queries-with.html
We try to avoid tests that really hit the database because they are expensive to run (like 20 seconds for those SQL queries, more like 5 seconds for all the other unit tests) but in a case like that you are not so concerned that the system generates the right SQL but that the SQL really works against real data structures.
20 years ago I thought mocks were a terrible boondoggle, then frameworks like Mockito came around which make them easy to write. Still there is something to say about having a system where you can test with true unit tests without mocks.