is there any suggested/recommended way of testing ...
# exposed
r
is there any suggested/recommended way of testing exposed-backed repositories? Or is it "just" firing exposed up using something like H2 and then "just" doing whatever tests I feel like?
b
a
Do you have any reason to not ”just” do that? 😅
m
I recommend testcontainers using the same database technology you will actually be using in production
1
r
@AdamW not that I know of, but sometimes people have good ideas that I aren't aware of 😉
@maxmello won't that slow down my tests, I try to keep them lean and fast, so they won't become a hazzle and afaik H2 is so close to postgres that it won't be an issue for the normal things
m
Of course its up to you what to do. I personally want to test as close to production as possible. And I definitely had problems with Exposed that were dependent on the database technology used in the past. From a performance perspective, the testcontainers setup adds maybe 20-30 seconds to running of the whole test suite (though the very first time it will be much slower, as it will download the image layers). I don’t know how that compares to using H2.
👍🏽 1