3 ms·
>This is not completely wrong but it's just telling you that the author has never worked in an environment where it makes sense. Anyone who has knows that this
by pydry 6y ago
>This is not completely wrong but it's just telling you that the author has never worked in an environment where it makes sense. Anyone who has knows that this approach can be used to catch a high fraction of errors locally, while not precluding a full slower CI build.
Sqlite isn't faster though. The only reason I can think of why people do run tests with sqlite instead of postgres or whatever is because you don't have to install it.
This is an undeniable benefit but it does mean that instead of having the up front cost of installing postgres wherever you have tests you have the ongoing cost of "oh, it looks like my test failed because sqlite and postgres aren't actually alike".
- acdha 6y agoIt is faster (same process, memory tables) but that’s my point: you can say you always need to test on your target database, which is true, but not needing to install things is a benefit, and that can matter when you’re doing integration tests with lots of data. I have seen plenty of projects where fast local SQLite + CI Postgres with lots of test data is reasonable.
- pydry 6y agoIt can suffice, but it will never be ideal. I had a project just a few weeks ago where somebody tried to do that and hit a brick wall nearly instantly because one table had an array column. SQLite instantly became useless. IME unrealistic tests bite much harder than slightly slower tests or needing to install the odd bit of software. Realism is pretty much the only thing that gives you confidence you'll actually catch some damn bugs...
- acdha 6y agoYou’ll note that I said the same thing. The point was just that the set of bugs people write includes both those which will affect any database and those which depend on certain configuration and behaviors. There are enough people who find it useful to do both that I’m comfortable saying any position which pretends they don’t exist is incomplete. As with the original author, the problem here is forgetting to add “On my projects” or “In my experience” rather than speaking in absolutes.