hugsql

valerauko 2019-05-01T06:34:19.004600Z

i mock all my db functions in my tests

valerauko 2019-05-01T06:34:36.005200Z

but if you'd want to test your actual sql then it's time to go down the rabbit hole

rgm 2019-05-01T13:06:11.008900Z

Thanks. One of the things that draws me to hugsql is the attitude of just directly using Postgres facilities (eg jsonb, triggers used sparingly), so there’s less testing surface than a ORM, but still some.

rgm 2019-05-01T13:08:07.011400Z

So now I’m imagining a rabbit hole in using spec to generate some of those mocks, and a smaller, slower, not-always-run test suite (like a performance suite) that hits a disposable test database.

rgm 2019-05-01T13:10:06.013900Z

(But when I notice I’m inventing things in my brain, I’ve come to take that as a signal that I should be looking harder for other people’s guidance).

valerauko 2019-05-01T16:30:13.014300Z

i prefer to write my own mocks and focus on their edge cases

valerauko 2019-05-01T16:30:52.015100Z

if hitting the db isn't an issue though then don't hold back

valerauko 2019-05-01T16:31:23.015800Z

i just enjoy my tests running in seconds instead of the 15 minutes a rails app can take (with 8-parallel)

rgm 2019-05-01T21:26:02.016200Z

yeah, I think I can stand up a second db with not too much trouble.

rgm 2019-05-01T21:28:47.016300Z

And a possibly stupid idea for integrating spec (enabling generative testing, dev-time instrumentation). Motivation is that I just want everything in one place.

😋 1